add String type + use String to make nominal types unique (worse, but more pleasant when debugging)
This commit is contained in:
parent
18b5e56ff0
commit
9405ba1b4e
9 changed files with 41 additions and 13 deletions
|
|
@ -1,7 +1,7 @@
|
|||
import { fnType, lsType } from "../type_registry.js";
|
||||
import {Type, Function} from "../metacircular.js";
|
||||
import { makeListModule } from "./list_common.js";
|
||||
import { Module } from "./module.js";
|
||||
import { Module } from "./list_types/module.js";
|
||||
|
||||
const Type_to_Type = fnType({in: Type, out: Type});
|
||||
const Type_to_Module = fnType({in: Type, out: Module});
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { makeListModule } from "./list_common.js";
|
||||
import { Typed } from "../typed.js";
|
||||
import { lsType } from "../type_registry.js";
|
||||
import { makeListModule } from "../list_common.js";
|
||||
import { Typed } from "../../typed.js";
|
||||
import { lsType } from "../../type_registry.js";
|
||||
|
||||
export const Module = lsType(Typed); // a Module is a list of Typeds
|
||||
|
||||
7
structures/list_types/string.js
Normal file
7
structures/list_types/string.js
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
import { Char } from "../../primitives/symbols.js";
|
||||
import { lsType } from "../../type_registry.js";
|
||||
import { makeListModule } from "../list_common.js";
|
||||
|
||||
export const String = lsType(Char);
|
||||
|
||||
export const ModuleString = makeListModule(Char);
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
import { fnType, prodType, sumType } from "../type_registry.js";
|
||||
import { Function, Type } from "../metacircular.js";
|
||||
import { Module } from "./module.js";
|
||||
import { Module } from "./list_types/module.js";
|
||||
|
||||
const constructorLeft = left => ({variant: "L", value: left });
|
||||
const constructorRight = right => ({variant: "R", value: right});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue