Browse Source

Add case...of code

Julian Ospald 4 years ago
parent
commit
b964f22c39
No account linked to committer's email address
1 changed files with 6 additions and 0 deletions
  1. 6
    0
      common/code/Code.hs

+ 6
- 0
common/code/Code.hs View File

@@ -51,3 +51,9 @@ addTwo (x:xs) = (x + 2) : addTwo xs
51 51
 
52 52
 f'' :: String -> Bool
53 53
 f'' xs = even . length . (\x -> x ++ "Hello world") $ xs
54
+
55
+g :: Int -> Bool
56
+g x = case x - 2 of
57
+  2 -> True
58
+  5 -> True
59
+  x -> False