rename function + update index
This commit is contained in:
parent
c1da60b71c
commit
28909d88b9
3 changed files with 10 additions and 4 deletions
|
|
@ -4,7 +4,7 @@ import { getSymbol } from "../primitives/type.js";
|
|||
import { isTypeVar, TYPE_VARS, UNBOUND_SYMBOLS } from "../primitives/typevars.js";
|
||||
import { symbolFunction } from "../structures/type_constructors.js";
|
||||
import { prettyT } from '../util/pretty.js';
|
||||
import { reduceUnif, unifyLL } from "./low_level.js";
|
||||
import { reduceUnification, unifyLL } from "./low_level.js";
|
||||
|
||||
// helper for creating generic types
|
||||
// for instance, the type:
|
||||
|
|
@ -41,7 +41,7 @@ export class NotAFunctionError extends Error {}
|
|||
export const unify = (fType, aType) => {
|
||||
[fType, aType] = recomputeTypeVars([fType, aType]);
|
||||
const unification = unifyLL(fType, aType);
|
||||
const substitutions = reduceUnif(unification);
|
||||
const substitutions = reduceUnification(unification);
|
||||
const uType = substitute(fType, // or aType, doesn't matter here
|
||||
substitutions);
|
||||
return recomputeTypeVars([uType])[0];
|
||||
|
|
@ -83,7 +83,7 @@ export const assignFn = (funType, paramType, skip=0) => {
|
|||
const unifInType1 = unifyLL(inType1, paramType1);
|
||||
|
||||
// Step 4: Substitute typevars in output type
|
||||
const substInType1 = reduceUnif(unifInType1);
|
||||
const substInType1 = reduceUnification(unifInType1);
|
||||
const reducedOutType1 = substitute(outType1, substInType1);
|
||||
|
||||
// Step 5: 'Normalize' output type
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue