import { setType, typedFnType } from "./types.js"; import { Bool, Type } from "../primitives/types.js"; import { makeGeneric } from "../generics/generics.js"; // 'normal' implementation const emptySet = new Set(); const has = set => elem => set.has(elem); const add = set => elem => new Set([...set, elem]); export const ModuleList = {l:[ // Type -> Type ...typedFnType(setType, fnType => fnType /* in */ (Type) /* out */ (Type) ), {i: emptySet, t: makeGeneric(a => setType(a))}, ...typedFnType(has, fnType => makeGeneric(a => fnType /* in */ (setType(a)) /* out */ (fnType /* in */ (a) /* out */ (Bool) ))), ...typedFnType(add, fnType => makeGeneric(a => fnType /* in */ (setType(a)) /* out */ (fnType /* in */ (a) /* out */ (setType(a)) ))), ]};