diff --git a/index.d.ts b/index.d.ts index 904d28c..67ce8ee 100644 --- a/index.d.ts +++ b/index.d.ts @@ -334,6 +334,10 @@ export function pretty(obj: 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 recomputeTypeVars(types: any, skip: number): any; diff --git a/lib/generics/low_level.js b/lib/generics/low_level.js index 414e8b9..d313060 100644 --- a/lib/generics/low_level.js +++ b/lib/generics/low_level.js @@ -142,9 +142,9 @@ export const reduceUnification = (unif) => { }; // For debugging -const prettyU = unif => { +export const prettyU = unif => { return `{${[...unif].map(([symbol, types]) => `${getHumanReadableName(symbol)} => ${prettyST(types)}`).join(', ')}}`; }; -const prettyST = st => { +export const prettyST = st => { return `(${st.keys().map(prettyT).join(',')})`; };