summaryrefslogtreecommitdiff
path: root/Utility/Misc.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-07-29 19:05:51 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-07-29 19:05:51 -0400
commitd62b157194248402b566e96bbc92d19b8e1ce6e8 (patch)
treeb7cb5cc9966dd8ceb5f81715a382c22abc6bf1c2 /Utility/Misc.hs
parentd52c93242450c0bd01e7d3c1fdae375806aa6e1f (diff)
better ordering of alerts
Diffstat (limited to 'Utility/Misc.hs')
-rw-r--r--Utility/Misc.hs7
1 files changed, 7 insertions, 0 deletions
diff --git a/Utility/Misc.hs b/Utility/Misc.hs
index e11586467..77ebb4f3d 100644
--- a/Utility/Misc.hs
+++ b/Utility/Misc.hs
@@ -45,3 +45,10 @@ segment p l = map reverse $ go [] [] l
go c r (i:is)
| p i = go [] (c:r) is
| otherwise = go (i:c) r is
+
+{- Given two orderings, returns the second if the first is EQ and returns
+ - the first otherwise. -}
+thenOrd :: Ordering -> Ordering -> Ordering
+thenOrd EQ x = x
+thenOrd x _ = x
+{-# INLINE thenOrd #-}