From 5b4be12e0b1253795c9412b2698bf7ab786ce755 Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Tue, 21 Apr 2015 14:14:24 +0200 Subject: [PATCH] Add case...of code --- common/code/Code.hs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/common/code/Code.hs b/common/code/Code.hs index 56c1dc8..c92e9a5 100644 --- a/common/code/Code.hs +++ b/common/code/Code.hs @@ -51,3 +51,9 @@ addTwo (x:xs) = (x + 2) : addTwo xs f'' :: String -> Bool f'' xs = even . length . (\x -> x ++ "Hello world") $ xs + +g :: Int -> Bool +g x = case x - 2 of + 2 -> True + 5 -> True + x -> False