aboutsummaryrefslogtreecommitdiff
path: root/backend/CC/Backend/Dumb.hs
diff options
context:
space:
mode:
authorTom Smeding <tom.smeding@gmail.com>2020-07-27 10:32:49 +0200
committerTom Smeding <tom.smeding@gmail.com>2020-07-27 10:32:49 +0200
commit4c9e6c7dc4468c05553b04ba0c1aca6964dc0f82 (patch)
tree48a6ec7c60d90a0cd45a600b1963ad3ea6466e8a /backend/CC/Backend/Dumb.hs
parent1ac7ba99fc809958ab59ed9b81df6fda7f2dbf05 (diff)
Fix unification and make union types workHEADmaster
Diffstat (limited to 'backend/CC/Backend/Dumb.hs')
-rw-r--r--backend/CC/Backend/Dumb.hs6
1 files changed, 5 insertions, 1 deletions
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