use fnType everywhere to create function types

This commit is contained in:
Joeri Exelmans 2025-03-14 17:05:04 +01:00
parent a8260f2afb
commit 6023efc295
10 changed files with 33 additions and 27 deletions

View file

@ -1,10 +1,11 @@
import { fnType } from "../function_registry.js";
import {Type, Function} from "../metacircular.js";
import {Bool} from "./symbols.js";
const eqBool = x => y => x === y;
const Bool_to_Bool = {in: Bool, out: Bool};
const Bool_to_Bool_to_Bool = {in: Bool, out: Bool_to_Bool};
const Bool_to_Bool = fnType({in: Bool, out: Bool});
const Bool_to_Bool_to_Bool = fnType({in: Bool, out: Bool_to_Bool});
export const ModuleBool = [
{i: Bool , t: Type },

View file

@ -1,3 +1,4 @@
import { fnType } from "../function_registry.js";
import {Type, Function} from "../metacircular.js";
import {Bool, Double} from "./symbols.js";
@ -6,10 +7,10 @@ export const addDouble = x => y => x + y;
export const mulDouble = x => y => x * y;
export const eqDouble = x => y => x === y;
const Double_to_Double = {in: Double, out: Double};
const Double_to_Bool = {in: Double, out: Bool};
export const Double_to_Double_to_Double = {in: Double, out: Double_to_Double};
export const Double_to_Double_to_Bool = {in: Double, out: Double_to_Bool};
const Double_to_Double = fnType({in: Double, out: Double});
const Double_to_Bool = fnType({in: Double, out: Bool});
export const Double_to_Double_to_Double = fnType({in: Double, out: Double_to_Double});
export const Double_to_Double_to_Bool = fnType({in: Double, out: Double_to_Bool});
export const ModuleDouble = [

View file

@ -1,3 +1,4 @@
import { fnType } from "../function_registry.js";
import {Type, Function} from "../metacircular.js";
import {Bool, Int} from "./symbols.js";
@ -6,10 +7,10 @@ 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};
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});
export const ModuleInt = [