lotta progress
This commit is contained in:
parent
29d20b2273
commit
bc91d9bf39
27 changed files with 317 additions and 475 deletions
|
|
@ -1,30 +1,19 @@
|
|||
import { fnType } from "../structures/function.js";
|
||||
import { Type } from "../metacircular.js";
|
||||
import { typedFnType } from "../structures/types.js";
|
||||
import { Type } from "../type.js";
|
||||
|
||||
import {Bool, Int} from "./symbols.js";
|
||||
import {Bool, Int} from "./types.js";
|
||||
|
||||
export const addInt = x => y => x + y;
|
||||
export const mulInt = x => y => x * y;
|
||||
export const eqInt = x => y => x === y;
|
||||
|
||||
const Int_to_Int = fnType({in: Int, out: Int });
|
||||
const Int_to_Bool = fnType({in: Int, out: Bool});
|
||||
export const Int_to_Int_to_Int = fnType({in: Int, out: Int_to_Int});
|
||||
export const Int_to_Int_to_Bool = fnType({in: Int, out: Int_to_Bool});
|
||||
|
||||
const serialize = x => x.toString();
|
||||
const deserialize = str => BigInt(str);
|
||||
|
||||
|
||||
export const ModuleInt = {l:[
|
||||
{i: Int , t: Type },
|
||||
|
||||
{i: Int_to_Int_to_Int , t: Function },
|
||||
{i: Int_to_Int_to_Bool , t: Function },
|
||||
{i: Int_to_Int , t: Function },
|
||||
{i: Int_to_Bool , t: Function },
|
||||
|
||||
{i: addInt , t: Int_to_Int_to_Int },
|
||||
{i: mulInt , t: Int_to_Int_to_Int },
|
||||
{i: eqInt , t: Int_to_Int_to_Bool },
|
||||
...typedFnType(addInt, fnType => fnType(Int)(fnType(Int)(Int))),
|
||||
...typedFnType(mulInt, fnType => fnType(Int)(fnType(Int)(Int))),
|
||||
...typedFnType(eqInt , fnType => fnType(Int)(fnType(Int)(Bool))),
|
||||
]};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue