interactive prompt
This commit is contained in:
parent
bc91d9bf39
commit
3596e01c28
9 changed files with 298 additions and 105 deletions
|
|
@ -8,19 +8,21 @@ import { eqDictType } from "./eq_type";
|
|||
export const getEq = numDict => numDict.eq;
|
||||
|
||||
export const ModuleEq = {l:[
|
||||
...typedFnType(eqDictType, fnType => fnType({in: Type, out: Type})),
|
||||
// type constructor: Type -> Type
|
||||
...typedFnType(eqDictType, fnType => fnType(Type)(Type)),
|
||||
|
||||
...typedFnType(getEq, fnType => makeGeneric(a =>
|
||||
fnType({
|
||||
in: eqDictType(a),
|
||||
out: fnType({
|
||||
in: a,
|
||||
out: fnType({
|
||||
in: a,
|
||||
out: Bool,
|
||||
}),
|
||||
}),
|
||||
}))),
|
||||
// (EqDict a) -> a -> a -> Bool
|
||||
...typedFnType(getEq, fnType =>
|
||||
makeGeneric(a =>
|
||||
fnType
|
||||
(eqDictType(a))
|
||||
(fnType
|
||||
(a)
|
||||
(fnType
|
||||
(a)
|
||||
(Bool)
|
||||
)
|
||||
))),
|
||||
]};
|
||||
|
||||
// all our data (and types) are encoded such that we can test equality the same way:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue