This commit is contained in:
Joeri Exelmans 2025-03-22 10:33:35 +01:00
parent 33c156fc5c
commit afd78c3b3e
5 changed files with 54 additions and 8 deletions

View file

@ -110,9 +110,7 @@ export const mergeSubstitutions = (m1, m2) => {
let d;
// notice we swap m2 and m1, so the rewriting can happen both ways:
[stable, m2, m1, d] = mergeOneWay(m1, m2);
if (!stable) {
deletedTypeVars = deletedTypeVars.union(d);
}
deletedTypeVars = deletedTypeVars.union(d);
}
return [new Map([...m1, ...m2]), deletedTypeVars];
}

View file

@ -2,7 +2,6 @@ import { Bool, Int } from "../primitives/symbols.js";
import { lsType } from "../structures/list_common.js";
import { fnType } from "../metacircular.js";
import { assign, makeGeneric, mergeSubstitutions, unify } from "./generics.js";
import { select } from "@inquirer/prompts";
// a -> Int
const a_to_Int = makeGeneric(a => fnType({in: a, out: Int}));