wrote new unify-function that always returns minimal set of substitutions
This commit is contained in:
parent
47786ae792
commit
68bd7cdb9f
3 changed files with 278 additions and 2 deletions
|
|
@ -1,5 +1,5 @@
|
|||
import assert from "node:assert";
|
||||
import { assignFn, makeGeneric, unify, UnifyError } from "../lib/generics/generics.js";
|
||||
import { assignFn, unify, UnifyError } from "../lib/generics/generics.js";
|
||||
import { getDefaultTypeParser } from "../lib/parser/type_parser.js";
|
||||
import { prettyT } from "../lib/util/pretty.js";
|
||||
|
||||
|
|
@ -12,7 +12,7 @@ assert.equal(
|
|||
prettyT(
|
||||
unify(
|
||||
mkType("(a -> Int)"),
|
||||
makeGeneric(() => mkType("[Bool] -> Int")),
|
||||
mkType("[Bool] -> Int"),
|
||||
)
|
||||
),
|
||||
// expected
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue