19 lines
618 B
JavaScript
19 lines
618 B
JavaScript
import { typedFnType } from "../structures/types.js";
|
|
import { Type } from "../type.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 serialize = x => x.toString();
|
|
const deserialize = str => BigInt(str);
|
|
|
|
export const ModuleInt = {l:[
|
|
{i: Int , t: Type },
|
|
|
|
...typedFnType(addInt, fnType => fnType(Int)(fnType(Int)(Int))),
|
|
...typedFnType(mulInt, fnType => fnType(Int)(fnType(Int)(Int))),
|
|
...typedFnType(eqInt , fnType => fnType(Int)(fnType(Int)(Bool))),
|
|
]};
|