浏览代码

Implement lesson example of guarded evaluation

DricomDragon 5 年之前
父节点
当前提交
09a3e8a526
共有 1 个文件被更改,包括 6 次插入0 次删除
  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