[project @ 1998-12-02 13:17:09 by simonm]
[ghc-hetmet.git] / ghc / interpreter / test / typechecker / t013.hs
diff --git a/ghc/interpreter/test/typechecker/t013.hs b/ghc/interpreter/test/typechecker/t013.hs
new file mode 100644 (file)
index 0000000..ac008ec
--- /dev/null
@@ -0,0 +1,8 @@
+--!!! Expr a (the classic existential types + polymorphic recursion example)
+
+data Expr a = App (Expr (b -> a)) (Expr b)
+            | K a
+
+eval :: Expr a -> a
+eval (App f x) = (eval f) (eval x)
+eval (K x)     = x