summaryrefslogtreecommitdiff
path: root/lc
diff options
context:
space:
mode:
authorPéter Diviánszky <divipp@gmail.com>2016-01-27 12:15:37 +0100
committerPéter Diviánszky <divipp@gmail.com>2016-01-27 12:15:43 +0100
commitdffb7cbe2a0922e92d08040508226becd46f349c (patch)
tree9ce4f06ae683b327ce5c5ce0c5622291f7cb0f2e /lc
parentc0a3b1a4a71af08398d561698765206a54114593 (diff)
first try to move wired-in constraint reductions into the library
Diffstat (limited to 'lc')
-rw-r--r--lc/Builtins.lc8
-rw-r--r--lc/Internals.lc17
2 files changed, 15 insertions, 10 deletions
diff --git a/lc/Builtins.lc b/lc/Builtins.lc
index 06713cec..b34f5fae 100644
--- a/lc/Builtins.lc
+++ b/lc/Builtins.lc
@@ -16,14 +16,6 @@ data List a = Nil | Cons a (List a)
16 16
17infixr 5 : 17infixr 5 :
18 18
19type family JoinTupleType t1 t2 where
20 -- TODO
21 JoinTupleType a () = a
22 JoinTupleType a (b, c) = (a, b, c)
23 JoinTupleType a (b, c, d) = (a, b, c, d)
24 JoinTupleType a (b, c, d, e) = (a, b, c, d, e)
25 JoinTupleType a b = (a, b)
26
27class AttributeTuple a 19class AttributeTuple a
28instance AttributeTuple a -- TODO 20instance AttributeTuple a -- TODO
29class ValidOutput a 21class ValidOutput a
diff --git a/lc/Internals.lc b/lc/Internals.lc
index aedb62fc..df5814e6 100644
--- a/lc/Internals.lc
+++ b/lc/Internals.lc
@@ -27,8 +27,21 @@ data Tuple5 a b c d e = Tuple5 a b c d e
27-- builtin used for overlapping instances 27-- builtin used for overlapping instances
28parEval :: forall a -> a -> a -> a 28parEval :: forall a -> a -> a -> a
29 29
30type family EqCT (t :: Type) (a :: t) (b :: t) -- equality constraints 30type family JoinTupleType t1 t2 where
31type family T2 a b -- conjuction of constraints 31 -- TODO
32 JoinTupleType a () = a
33 JoinTupleType a (b, c) = (a, b, c)
34 JoinTupleType a (b, c, d) = (a, b, c, d)
35 JoinTupleType a (b, c, d, e) = (a, b, c, d, e)
36 JoinTupleType a b = (a, b)
37
38-- conjuction of constraints
39type family T2 a b
40
41-- equality constraints
42type family EqCT (t :: Type) (a :: t) (b :: t)
43
44--type instance EqCT t (a, b) (JoinTupleType a' b') = T2 (EqCT Type a a') (EqCT Type b b')
32 45
33-- builtin conjuction of constraint witnesses 46-- builtin conjuction of constraint witnesses
34t2C :: Unit -> Unit -> Unit 47t2C :: Unit -> Unit -> Unit