浏览代码

exercise 3.4: bagFee Bool -> Int

George C. Privon 2 年之前
父节点
当前提交
f09366476a
共有 1 个文件被更改,包括 12 次插入0 次删除
  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