wrote new unify-function that always returns minimal set of reductions

This commit is contained in:
Joeri Exelmans 2025-05-23 14:04:39 +02:00
parent 47786ae792
commit 6fd4a4c0e1
3 changed files with 278 additions and 2 deletions

View file

@ -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