Browse Source

exercise 3.4: bagFee Bool -> Int

George C. Privon 2 years ago
parent
commit
f09366476a
1 changed files with 12 additions and 0 deletions
  1. 12 0
      03-typesandentities/exercises/ex3.4.hs

+ 12 - 0
03-typesandentities/exercises/ex3.4.hs

@@ -0,0 +1,12 @@
+-- Exercise 3.4
+-- George C. Privon
+-- 2023-09-05
+
+bagFee :: Bool -> Int
+bagFee x = if x
+    then 100
+    else 0
+
+bagFee2 :: Bool -> Int
+bagFee2 False = 0
+bagFee2 True = 100