better ordering of alerts

This commit is contained in:
Joey Hess 2012-07-29 19:05:51 -04:00
parent d52c932424
commit d62b157194
6 changed files with 60 additions and 15 deletions

View file

@ -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 #-}