bindist checker improvements
[ghc-hetmet.git] / distrib / compare / Utils.hs
index d5fb8cb..e2da6b5 100644 (file)
@@ -1,6 +1,8 @@
 
 module Utils where
 
+import Data.Function
+import Data.List
 import System.Exit
 import System.IO
 import Text.Regex.Posix
@@ -33,3 +35,6 @@ unSepList x xs = case break (x ==) xs of
                  (this, []) ->
                      [this]
 
+sortByFst :: Ord a => [(a, b)] -> [(a, b)]
+sortByFst = sortBy (compare `on` fst)
+