From 4c9e6c7dc4468c05553b04ba0c1aca6964dc0f82 Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Mon, 27 Jul 2020 10:32:49 +0200 Subject: Fix unification and make union types work --- backend/CC/Backend/Dumb.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'backend/CC') diff --git a/backend/CC/Backend/Dumb.hs b/backend/CC/Backend/Dumb.hs index 822fb84..b7703d7 100644 --- a/backend/CC/Backend/Dumb.hs +++ b/backend/CC/Backend/Dumb.hs @@ -17,7 +17,11 @@ builtins = , ("_mul", TInt ==> TInt ==> TInt) ] prelude = "type Nil = ()\n\ \type Cons a = (a, List a)\n\ - \alias List a = { Nil | Cons a }\n" + \alias List a = { Nil | Cons a }\n\ + \cons :: a -> List a -> Cons a\n\ + \cons x l = Cons (x, l)\n\ + \nil :: Nil\n\ + \nil = Nil ()\n" in Builtins values prelude where t1 = TyVar Instantiable 1 -- cgit v1.2.3-70-g09d2