mirror of
https://github.com/github/semantic.git
synced 2024-12-29 18:06:14 +03:00
Define a comparability relation for terms.
This commit is contained in:
parent
adcaed3ec0
commit
d453a7f2df
@ -106,6 +106,12 @@ algorithmForTerms t1@(Term (In ann1 f1)) t2@(Term (In ann2 f2))
|
||||
<|> insertF . In ann2 <$> subalgorithmFor byInserting ( mergeFor t1) f2
|
||||
where mergeFor (Term (In ann1 f1)) (Term (In ann2 f2)) = merge (ann1, ann2) <$> algorithmFor f1 f2
|
||||
|
||||
comparableTerms :: Diffable syntax
|
||||
=> TermF syntax ann1 term1
|
||||
-> TermF syntax ann2 term2
|
||||
-> Bool
|
||||
comparableTerms (In _ syntax1) (In _ syntax2) = comparableTo syntax1 syntax2
|
||||
|
||||
equivalentTerms :: (Diffable syntax, Eq1 syntax)
|
||||
=> Term syntax ann1
|
||||
-> Term syntax ann2
|
||||
|
Loading…
Reference in New Issue
Block a user