public void Unify(free <type> t, int i) { if (Failed) { return; } _vars.Unify(Rule(t), User(i, Type(i))); if (_vars.Failed) { Error = GenerateError($"could not match {i} with inference rule type {t}", new[] { Source(i) }); } }
private type User(int i, free <type> free) => _userScopes[i].Unfree(free);
private type Rule(free <type> free) => _ruleScope.Unfree(free);
public static free <term> Canonicalize(this free <term> term) { return(free.Of(new Canonicalizer().Canonicalize(term.UnsafeValue))); }
public static free <type> Canonicalize(this free <type> type) { return(free.Of(new Canonicalizer().Canonicalize(type.UnsafeValue))); }
public term Unfree(free <term> fterm) { var val = fterm.UnsafeValue; return(Unfree(val)); }