1
1
mirror of https://github.com/github/semantic.git synced 2024-12-27 17:05:33 +03:00

Don’t require equal when the leaf type is Equatable.

This commit is contained in:
Rob Rix 2015-10-15 14:34:47 -04:00
parent 62c13aed65
commit 662fbe7dbc

View File

@ -77,4 +77,13 @@ public struct Interpreter<Term: TermType> {
}
// MARK: - Constrained constructors
extension Interpreter where Term.LeafType: Equatable {
public init(comparable: (Term, Term) -> Bool, cost: Diff -> Int) {
self.init(equal: Term.equals(==), comparable: comparable, cost: cost)
}
}
import Prelude