// import {Type, Function, makeTypedFnInOut, fnIn, fnOut} from "../metacircular.js"; // import {Conformable, conformanceCheck} from "./conformable.js"; // import {Bool} from "../primitives/symbols.js"; // import {deepEqual} from "../util.js"; // export const Num = Symbol('Num'); // export const NumDict = Symbol('NumDict'); // // export const addType = Symbol('addType'); // // export const addBoundType = Symbol('addBoundType'); // // export const mulType = Symbol('mulType'); // // export const mulBoundType = Symbol('mulBoundType'); // // export const getType = numDict => numDict.type; // export const getAdd = numDict => numDict.add; // export const getMul = numDict => numDict.mul; // // const addOrMulIsConform = fn => { // // // function signature must be: a -> a -> a // // const i0 = fnIn(fn); // // const o0 = fnOut(fn); // // const i1 = fnIn(o0); // // const o1 = fnOut(o0); // // return deepEqual(i0, i1) && deepEqual(i1, o1); // // }; // // const addIsConform = {name: "isConform", inType: addType, outType: Bool, fn: addOrMulIsConform}; // // const mulIsConform = {name: "isConform", inType: mulType, outType: Bool, fn: addOrMulIsConform}; // export const ModuleNum = [ // {i: Num, t: Type}, // {i: NumDict, t: Type}, // {i: addType, t: Type}, // {i: addBoundType, t: Type}, // {i: mulType, t: Type}, // {i: mulBoundType, t: Type}, // {i: {name: "getType", inType: NumDict, outType: Num, fn: getType}, t: Function}, // {i: {name: "getAdd", inType: NumDict, outType: addType, fn: getAdd }, t: Function}, // {i: {name: "getMul", inType: NumDict, outType: mulType, fn: getMul }, t: Function}, // ...makeTypedFnInOut({f: addType , inType: Num, outType: addBoundType}), // ...makeTypedFnInOut({f: addBoundType, inType: Num, outType: Num }), // ...makeTypedFnInOut({f: mulType , inType: Num, outType: mulBoundType}), // ...makeTypedFnInOut({f: mulBoundType, inType: Num, outType: Num }), // // conformance checking type class // {i: addType, t: Conformable}, // {i: mulType, t: Conformable}, // {i: addIsConform, t: Function}, // {i: addIsConform, t: conformanceCheck}, // {i: mulIsConform, t: Function}, // {i: mulIsConform, t: conformanceCheck}, // ];