Sfoglia il codice sorgente

Implement lesson example of guarded evaluation

DricomDragon 5 anni fa
parent
commit
09a3e8a526
1 ha cambiato i file con 6 aggiunte e 0 eliminazioni
  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