Explorar el Código

Implement lesson example of guarded evaluation

DricomDragon hace 5 años
padre
commit
09a3e8a526
Se han modificado 1 ficheros con 6 adiciones y 0 borrados
  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