aboutsummaryrefslogtreecommitdiff
path: root/examples/tc.hs
diff options
context:
space:
mode:
Diffstat (limited to 'examples/tc.hs')
-rw-r--r--examples/tc.hs10
1 files changed, 10 insertions, 0 deletions
diff --git a/examples/tc.hs b/examples/tc.hs
new file mode 100644
index 0000000..c27c736
--- /dev/null
+++ b/examples/tc.hs
@@ -0,0 +1,10 @@
+data Bool = False | True
+data List a = Nil | Cons a (List a)
+
+isNil :: List a -> Bool
+isNil Nil = True
+isNil (Cons _ _) = False
+
+map :: (a -> b) -> List a -> List b
+map _ Nil = Nil
+map f (Cons x l) = Cons (f x) (map f l)