basic functionality, no generics
This commit is contained in:
commit
a8260f2afb
17 changed files with 615 additions and 0 deletions
26
primitives/int.js
Normal file
26
primitives/int.js
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
import {Type, Function} from "../metacircular.js";
|
||||
|
||||
import {Bool, Int} from "./symbols.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 = {in: Int, out: Int };
|
||||
const Int_to_Bool = {in: Int, out: Bool};
|
||||
export const Int_to_Int_to_Int = {in: Int, out: Int_to_Int};
|
||||
export const Int_to_Int_to_Bool = {in: Int, out: Int_to_Bool};
|
||||
|
||||
|
||||
export const ModuleInt = [
|
||||
{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 },
|
||||
];
|
||||
Loading…
Add table
Add a link
Reference in a new issue