1
1
mirror of https://github.com/github/semantic.git synced 2024-12-25 16:02:43 +03:00

If not comparable, don’t compare.

This commit is contained in:
Rob Rix 2015-11-18 11:13:13 -08:00
parent 6f49840fc8
commit da5807180a

View File

@ -11,6 +11,7 @@ import Patch
import SES
constructAndRun :: Eq a => Comparable a -> Term a Info -> Term a Info -> Maybe (Diff a)
constructAndRun comparable a b | not $ comparable a b = Nothing
constructAndRun comparable a b =
run comparable $ algorithm a b where
algorithm (_ :< Indexed a) (_ :< Indexed b) = Free $ ByIndex a b (Pure . Free . Indexed)