progress and some refactoring
This commit is contained in:
parent
d236eca5e5
commit
d8ca2f3999
25 changed files with 376 additions and 163 deletions
|
|
@ -1,8 +1,8 @@
|
|||
import { makeGeneric } from "../generics/generics";
|
||||
import { Type } from "../primitives/types";
|
||||
import { SymbolT, Type, Unit } from "../primitives/types";
|
||||
import { typedFnType } from "../structures/types";
|
||||
import { Bool, Byte, Char, Double, Int } from "../primitives/types";
|
||||
import { deepEqual } from "../util";
|
||||
import { deepEqual } from "../util/util";
|
||||
import { eqDictType } from "./eq_type";
|
||||
|
||||
export const getEq = numDict => numDict.eq;
|
||||
|
|
@ -32,10 +32,12 @@ const eq = x => y => deepEqual(x,y);
|
|||
const EqDict = {eq};
|
||||
|
||||
export const EqInstances = new Map([
|
||||
[Int , EqDict],
|
||||
[Bool , EqDict],
|
||||
[Double, EqDict],
|
||||
[Byte , EqDict],
|
||||
[Char , EqDict],
|
||||
[Type , EqDict],
|
||||
[Int , EqDict],
|
||||
[Bool , EqDict],
|
||||
[Double , EqDict],
|
||||
[Byte , EqDict],
|
||||
[Char , EqDict],
|
||||
[Unit , EqDict],
|
||||
[Type , EqDict],
|
||||
[SymbolT, EqDict],
|
||||
]);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { DefaultMap } from "../util.js";
|
||||
import { DefaultMap } from "../util/defaultmap.js";
|
||||
|
||||
const eqDictSymbol = Symbol('EqDict');
|
||||
const eqDictTypeRegistry = new DefaultMap(a => ({
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import { assign } from "../generics/generics.js";
|
|||
import { makeGeneric } from "../generics/generics.js";
|
||||
import { Double, Int } from "../primitives/types.js";
|
||||
import { fnType } from "../structures/types.js";
|
||||
import { pretty } from "../util.js";
|
||||
import { pretty } from '../util/pretty.js';
|
||||
import { getMul, NumInstances } from "./num.js";
|
||||
import { numDictType } from "./num_type.js";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { DefaultMap } from "../util.js";
|
||||
import { DefaultMap } from "../util/defaultmap.js";
|
||||
|
||||
const numDictSymbol = Symbol("NumDict");
|
||||
const numDictTypeRegistry = new DefaultMap(a => ({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue