diff options
author | Péter Diviánszky <divipp@gmail.com> | 2016-01-27 12:15:37 +0100 |
---|---|---|
committer | Péter Diviánszky <divipp@gmail.com> | 2016-01-27 12:15:43 +0100 |
commit | dffb7cbe2a0922e92d08040508226becd46f349c (patch) | |
tree | 9ce4f06ae683b327ce5c5ce0c5622291f7cb0f2e /lc | |
parent | c0a3b1a4a71af08398d561698765206a54114593 (diff) |
first try to move wired-in constraint reductions into the library
Diffstat (limited to 'lc')
-rw-r--r-- | lc/Builtins.lc | 8 | ||||
-rw-r--r-- | lc/Internals.lc | 17 |
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 | ||
17 | infixr 5 : | 17 | infixr 5 : |
18 | 18 | ||
19 | type 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 | |||
27 | class AttributeTuple a | 19 | class AttributeTuple a |
28 | instance AttributeTuple a -- TODO | 20 | instance AttributeTuple a -- TODO |
29 | class ValidOutput a | 21 | class 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 |
28 | parEval :: forall a -> a -> a -> a | 28 | parEval :: forall a -> a -> a -> a |
29 | 29 | ||
30 | type family EqCT (t :: Type) (a :: t) (b :: t) -- equality constraints | 30 | type family JoinTupleType t1 t2 where |
31 | type 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 | ||
39 | type family T2 a b | ||
40 | |||
41 | -- equality constraints | ||
42 | type 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 |
34 | t2C :: Unit -> Unit -> Unit | 47 | t2C :: Unit -> Unit -> Unit |