From 417f27cc391971f15f36c2c5dcbb1ad962278ae5 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Thu, 19 Nov 2015 16:07:30 -0800 Subject: [PATCH] String/range pairs are ordered. --- src/Unified.hs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Unified.hs b/src/Unified.hs index a34396ecf..ed8380a14 100644 --- a/src/Unified.hs +++ b/src/Unified.hs @@ -34,3 +34,7 @@ range :: Patch (Term a Info) -> Maybe Range range patch = range . extract <$> after patch where extract (annotation :< _) = annotation range (Info range _) = range + +instance Ord (String, Maybe Range) where + (_, Just a) <= (_, Just b) = start a <= start b + _ <= _ = False