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:
parent
62c13aed65
commit
662fbe7dbc
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user