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
11
primitives/char.js
Normal file
11
primitives/char.js
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
import { typedFnType } from "../type_registry.js";
|
||||
import {Type} from "../metacircular.js";
|
||||
import {Char, Bool} from "./symbols.js";
|
||||
|
||||
const eq = x => y => x === y;
|
||||
|
||||
export const ModuleChar = {l:[
|
||||
{i: Char, t: Type},
|
||||
|
||||
...typedFnType(eq, fnType => fnType({in: Char, out: fnType({in: Char, out: Bool})})),
|
||||
]};
|
||||
|
|
@ -3,4 +3,5 @@
|
|||
export const Bool = Symbol('Bool');
|
||||
export const Int = Symbol('Int');
|
||||
export const Double = Symbol('Double');
|
||||
export const Byte = Symbol('Byte');
|
||||
export const Byte = Symbol('Byte');
|
||||
export const Char = Symbol('Char');
|
||||
Loading…
Add table
Add a link
Reference in a new issue