diff --git a/examples/environment.js b/examples/environment.js index 6a741c8..ba6e547 100644 --- a/examples/environment.js +++ b/examples/environment.js @@ -2,17 +2,17 @@ import { number, select } from "@inquirer/prompts"; import { makeCompareFn } from "../lib/compare/dynamic.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 { Bool, Double, Int, Type, UUID } from "../lib/primitives/primitive_types.js"; import { eqType, getSymbol } from "../lib/primitives/type.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 { add, emptySet, fold as foldSet } from "../lib/structures/set.js"; import { symbolFunction } from "../lib/structures/type_constructors.js"; import { pretty, prettyT } from "../lib/util/pretty.js"; import { genUUID } from "../lib/util/random.js"; -import { assignFn, unify } from "../lib/generics/generics.js"; // console.log(ModuleStd); diff --git a/lib/structures/type_constructors.types.js b/lib/structures/type_constructors.types.js index bbc7b85..32a42e1 100644 --- a/lib/structures/type_constructors.types.js +++ b/lib/structures/type_constructors.types.js @@ -11,23 +11,27 @@ export const setType = makeTypeConstructor(symbolSet)(1); export const dictType = makeTypeConstructor(symbolDict)(2); export const ModuleStructuralSymbols = [ - newDynamic(symbolSet )(UUID ), - newDynamic(symbolList )(UUID ), - newDynamic(symbolProduct )(UUID ), - newDynamic(symbolSum )(UUID ), - newDynamic(symbolDict )(UUID ), - newDynamic(symbolFunction )(UUID ), + newDynamic(symbolSet )(UUID), + newDynamic(symbolList )(UUID), + newDynamic(symbolProduct )(UUID), + newDynamic(symbolSum )(UUID), + newDynamic(symbolDict )(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 = [ - newDynamic(setType )(unaryTypeConstructor ), - newDynamic(lsType )(unaryTypeConstructor ), - newDynamic(prodType )(binaryTypeConstructor ), - newDynamic(sumType )(binaryTypeConstructor ), - newDynamic(dictType )(binaryTypeConstructor ), - newDynamic(fnType )(binaryTypeConstructor ), + newDynamic(setType )(unaryTypeConstructor ), + newDynamic(lsType )(unaryTypeConstructor ), + newDynamic(prodType)(binaryTypeConstructor), + newDynamic(sumType )(binaryTypeConstructor), + newDynamic(dictType)(binaryTypeConstructor), + newDynamic(fnType )(binaryTypeConstructor), ];