1
1
mirror of https://github.com/github/semantic.git synced 2024-11-29 02:44:36 +03:00

Document the equals parameter.

This commit is contained in:
Rob Rix 2015-10-15 14:12:39 -04:00
parent 260a317194
commit a34b5a34f4

View File

@ -110,6 +110,9 @@ extension Algorithm where B: FreeConvertible, B.RollType == Term.LeafType, B.Pur
return evaluate(equals, recur: { Algorithm($0, $1).evaluate(equals).free })
}
/// Evaluate the algorithm.
///
/// `equals` compares two terms for equality. It should be strictly syntactic equality, ignoring any annotations/metadata on the terms.
public func evaluate<C>(equals: (Term, Term) -> Bool, categorize: Term -> Set<C>) -> B {
return evaluate(equals, recur: {
let c0 = categorize($0)