recursive types (and operations on them, like pretty-printing, comparison and unification) seem to be working.
big part of the code base still needs to be 'ported' to the updated type constructors.
This commit is contained in:
parent
55c5d7cffa
commit
8eec5b9239
34 changed files with 523 additions and 295 deletions
|
|
@ -23,40 +23,40 @@ export const ModuleSum = {l:[
|
|||
// Type -> Type -> Type
|
||||
...typedFnType(sumType, fnType =>
|
||||
fnType
|
||||
(Type)
|
||||
(fnType
|
||||
(Type)
|
||||
(Type)
|
||||
(() => Type)
|
||||
(() => fnType
|
||||
(() => Type)
|
||||
(() => Type)
|
||||
),
|
||||
),
|
||||
|
||||
// a -> a | b
|
||||
...typedFnType(newLeft, fnType =>
|
||||
makeGeneric((a, b) =>
|
||||
fnType
|
||||
(a)
|
||||
(sumType(a)(b))
|
||||
), GenericType),
|
||||
// // a -> a | b
|
||||
// ...typedFnType(newLeft, fnType =>
|
||||
// makeGeneric((a, b) =>
|
||||
// fnType
|
||||
// (a)
|
||||
// (sumType(() => a)(() => b))
|
||||
// ), GenericType),
|
||||
|
||||
// b -> a | b
|
||||
...typedFnType(newRight, fnType =>
|
||||
makeGeneric((a, b) =>
|
||||
fnType
|
||||
(b)
|
||||
(sumType(a)(b))
|
||||
), GenericType),
|
||||
// // b -> a | b
|
||||
// ...typedFnType(newRight, fnType =>
|
||||
// makeGeneric((a, b) =>
|
||||
// fnType
|
||||
// (b)
|
||||
// (sumType(() => a)(() => b))
|
||||
// ), GenericType),
|
||||
|
||||
// a | b -> (a -> c, b-> c) -> c
|
||||
...typedFnType(match, fnType =>
|
||||
makeGeneric((a, b, c) =>
|
||||
fnType
|
||||
(sumType(a)(b))
|
||||
(fnType
|
||||
(prodType
|
||||
(fnType(a)(c))
|
||||
(fnType(b)(c))
|
||||
)
|
||||
(c)
|
||||
)
|
||||
), GenericType),
|
||||
// // a | b -> (a -> c, b-> c) -> c
|
||||
// ...typedFnType(match, fnType =>
|
||||
// makeGeneric((a, b, c) =>
|
||||
// fnType
|
||||
// (() => sumType(() => a)(() => b))
|
||||
// (() => fnType
|
||||
// (() => prodType
|
||||
// (() => fnType(() => a)(() => c))
|
||||
// (() => fnType(() => b)(() => c))
|
||||
// )
|
||||
// (() => c)
|
||||
// )
|
||||
// ), GenericType),
|
||||
]};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue