Kaynağa Gözat

exercise 3.4: bagFee Bool -> Int

George C. Privon 2 yıl önce
ebeveyn
işleme
f09366476a
1 değiştirilmiş dosya ile 12 ekleme ve 0 silme
  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