Browse Source

exercise 3.4: bagFee Bool -> Int

George C. Privon 2 năm trước cách đây
mục cha
commit
f09366476a
1 tập tin đã thay đổi với 12 bổ sung0 xóa
  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