interactive prompt can handle polymorphic types
This commit is contained in:
parent
a0e3aa0cb3
commit
4a4983f693
20 changed files with 485 additions and 276 deletions
|
|
@ -9,17 +9,22 @@ const symbolVersioned = Symbol("Versioned");
|
|||
export const versionedType = makeTypeConstructor(symbolVersioned)(1);
|
||||
|
||||
|
||||
export const constructor = parents => value => {
|
||||
export const constructor = parents => alternatives => {
|
||||
return { parents, alternatives };
|
||||
}
|
||||
|
||||
const constructorType = makeGeneric(a =>
|
||||
fnType
|
||||
(a)
|
||||
(setType(versionedType(a)))
|
||||
(fnType
|
||||
(setType(a))
|
||||
(versionedType(a))
|
||||
)
|
||||
);
|
||||
|
||||
// const getValue = v =>
|
||||
const initial = x => ({ parents: new Set(), alternatives: new Set(x) });
|
||||
|
||||
const initialFnType = makeGeneric(a => fnType(a)(versionedType(a)));
|
||||
|
||||
const eq = eqDict => vA => vB => {
|
||||
return getEq(eqDict)(vA.value,vB.value) // compare values
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue