1
1
mirror of https://github.com/github/semantic.git synced 2024-11-25 21:43:07 +03:00

Convenience constructor for Interpreters with Categorizable annotations.

This commit is contained in:
Rob Rix 2015-10-15 15:43:18 -04:00
parent 1e53b446ab
commit 1690c71cb2

View File

@ -98,5 +98,11 @@ extension Interpreter where Term.LeafType: Equatable {
}
}
extension Interpreter where Term: CofreeType, Term.Annotation: Categorizable {
public init(equal: (Term, Term) -> Bool, cost: Diff -> Int) {
self.init(equal: equal, comparable: Interpreter.comparable { $0.extract.categories }, cost: cost)
}
}
import Prelude