add interactive prompt

This commit is contained in:
Joeri Exelmans 2025-03-20 09:54:11 +01:00
parent ce192b49f2
commit 94efde3e65
22 changed files with 599 additions and 138 deletions

View file

@ -1,6 +1,5 @@
import { Bool, Int } from "../primitives/symbols.js";
import { fnType, lsType } from "../type_registry.js";
import { deepEqual } from "../util.js";
import { deepEqual, pretty } from "../util.js";
export const makeGeneric = callback => {
// type variables to make available:
@ -32,12 +31,11 @@ const occurring = (type, typeVars) => {
return new Set();
}
// merge_int(1, 2) => conflict(1,2)
// merge_list_of_int([1], [2]) => [conflict(1,2)]
import { inspect } from 'node:util';
// merge {i: [1], t: List_of_Int} ->
function pretty(obj) {
return inspect(obj, {colors: true});
}
export const matchGeneric = (
{typeVars: formalTypeVars, type: formalType},