Browse Source

Implement lesson example of guarded evaluation

DricomDragon 5 years ago
parent
commit
09a3e8a526
1 changed files with 6 additions and 0 deletions
  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