export a bit more

This commit is contained in:
Joeri Exelmans 2025-05-19 13:50:03 +02:00
parent 0896dfae4e
commit 1fe4085844
2 changed files with 6 additions and 2 deletions

4
index.d.ts vendored
View file

@ -334,6 +334,10 @@ export function pretty(obj: any): any;
export function prettyT(type: any): any; export function prettyT(type: any): any;
export function prettyU(unification: any): string;
export function prettyST(setOfTypes: any): string;
export function prodType(typeParam: any): any; export function prodType(typeParam: any): any;
export function recomputeTypeVars(types: any, skip: number): any; export function recomputeTypeVars(types: any, skip: number): any;

View file

@ -142,9 +142,9 @@ export const reduceUnification = (unif) => {
}; };
// For debugging // For debugging
const prettyU = unif => { export const prettyU = unif => {
return `{${[...unif].map(([symbol, types]) => `${getHumanReadableName(symbol)} => ${prettyST(types)}`).join(', ')}}`; return `{${[...unif].map(([symbol, types]) => `${getHumanReadableName(symbol)} => ${prettyST(types)}`).join(', ')}}`;
}; };
const prettyST = st => { export const prettyST = st => {
return `(${st.keys().map(prettyT).join(',')})`; return `(${st.keys().map(prettyT).join(',')})`;
}; };