Selaa lähdekoodia

Implement lesson example of guarded evaluation

DricomDragon 5 vuotta sitten
vanhempi
commit
09a3e8a526
1 muutettua tiedostoa jossa 6 lisäystä ja 0 poistoa
  1. 6 0
      guard.hs

+ 6 - 0
guard.hs

@@ -0,0 +1,6 @@
+-- Slide 10/78
+
+sign n
+    | n < 0 = -1
+    | n > 0 = 1
+    | otherwise = 0