This commit is contained in:
Joeri Exelmans 2025-05-09 15:03:17 +02:00
parent b1c2e7836d
commit 255bc475d7
2 changed files with 20 additions and 16 deletions

View file

@ -2,17 +2,17 @@ import { number, select } from "@inquirer/prompts";
import { makeCompareFn } from "../lib/compare/dynamic.js"; import { makeCompareFn } from "../lib/compare/dynamic.js";
import { compareTypes } from "../lib/compare/type.js"; import { compareTypes } from "../lib/compare/type.js";
import { assignFn } from "../lib/generics/generics.js";
import { getInst, getType, newDynamic } from "../lib/primitives/dynamic.js"; import { getInst, getType, newDynamic } from "../lib/primitives/dynamic.js";
import { Bool, Double, Int, Type, UUID } from "../lib/primitives/primitive_types.js"; import { Bool, Double, Int, Type, UUID } from "../lib/primitives/primitive_types.js";
import { eqType, getSymbol } from "../lib/primitives/type.js"; import { eqType, getSymbol } from "../lib/primitives/type.js";
import { ModuleStd } from "../lib/stdlib.js"; import { ModuleStd } from "../lib/stdlib.js";
import { emptyDict, get, set, fold as foldDict } from "../lib/structures/dict.js"; import { emptyDict, get, set } from "../lib/structures/dict.js";
import { fold as foldList } from "../lib/structures/list.js"; import { fold as foldList } from "../lib/structures/list.js";
import { add, emptySet, fold as foldSet } from "../lib/structures/set.js"; import { add, emptySet, fold as foldSet } from "../lib/structures/set.js";
import { symbolFunction } from "../lib/structures/type_constructors.js"; import { symbolFunction } from "../lib/structures/type_constructors.js";
import { pretty, prettyT } from "../lib/util/pretty.js"; import { pretty, prettyT } from "../lib/util/pretty.js";
import { genUUID } from "../lib/util/random.js"; import { genUUID } from "../lib/util/random.js";
import { assignFn, unify } from "../lib/generics/generics.js";
// console.log(ModuleStd); // console.log(ModuleStd);

View file

@ -11,23 +11,27 @@ export const setType = makeTypeConstructor(symbolSet)(1);
export const dictType = makeTypeConstructor(symbolDict)(2); export const dictType = makeTypeConstructor(symbolDict)(2);
export const ModuleStructuralSymbols = [ export const ModuleStructuralSymbols = [
newDynamic(symbolSet )(UUID ), newDynamic(symbolSet )(UUID),
newDynamic(symbolList )(UUID ), newDynamic(symbolList )(UUID),
newDynamic(symbolProduct )(UUID ), newDynamic(symbolProduct )(UUID),
newDynamic(symbolSum )(UUID ), newDynamic(symbolSum )(UUID),
newDynamic(symbolDict )(UUID ), newDynamic(symbolDict )(UUID),
newDynamic(symbolFunction )(UUID ), newDynamic(symbolFunction)(UUID),
]; ];
const unaryTypeConstructor = fnType(_ => Type)(_ => Type); const unaryTypeConstructor = fnType
(_ => fnType(_ => Type)(_ => Type))
(_ => Type);
const binaryTypeConstructor = fnType(_ => Type)(_ => unaryTypeConstructor); const binaryTypeConstructor = fnType
(_ => fnType(_ => Type)(_ => Type))
(_ => unaryTypeConstructor);
export const ModuleTypeConstructors = [ export const ModuleTypeConstructors = [
newDynamic(setType )(unaryTypeConstructor ), newDynamic(setType )(unaryTypeConstructor ),
newDynamic(lsType )(unaryTypeConstructor ), newDynamic(lsType )(unaryTypeConstructor ),
newDynamic(prodType )(binaryTypeConstructor ), newDynamic(prodType)(binaryTypeConstructor),
newDynamic(sumType )(binaryTypeConstructor ), newDynamic(sumType )(binaryTypeConstructor),
newDynamic(dictType )(binaryTypeConstructor ), newDynamic(dictType)(binaryTypeConstructor),
newDynamic(fnType )(binaryTypeConstructor ), newDynamic(fnType )(binaryTypeConstructor),
]; ];