summaryrefslogtreecommitdiff
path: root/src/GF/Data/Utilities.hs
diff options
context:
space:
mode:
authorbringert <bringert@cs.chalmers.se>2006-02-01 16:23:14 +0000
committerbringert <bringert@cs.chalmers.se>2006-02-01 16:23:14 +0000
commitfd0dfd7d4d9885b8b4cac7bd60308e2890a05caa (patch)
tree73613f4cc00fac0d683220bcc4258bdb99179914 /src/GF/Data/Utilities.hs
parent992e212bccec9f30ee7b4f5e764b0bd793ccc651 (diff)
First version of SRGS with semantic tags.
Diffstat (limited to 'src/GF/Data/Utilities.hs')
-rw-r--r--src/GF/Data/Utilities.hs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/GF/Data/Utilities.hs b/src/GF/Data/Utilities.hs
index aaadad1fe..c7e1600c3 100644
--- a/src/GF/Data/Utilities.hs
+++ b/src/GF/Data/Utilities.hs
@@ -73,7 +73,12 @@ sortNub = map head . group . sort
-- | Like 'nubBy', but more efficient as it uses sorting internally.
sortNubBy :: (a -> a -> Ordering) -> [a] -> [a]
-sortNubBy f = map head . groupBy (compareEq f) . sortBy f
+sortNubBy f = map head . sortGroupBy f
+
+-- | Sorts and then groups elements given and ordering of the
+-- elements.
+sortGroupBy :: (a -> a -> Ordering) -> [a] -> [[a]]
+sortGroupBy f = groupBy (compareEq f) . sortBy f
-- | Take the union of a list of lists.
unionAll :: Eq a => [[a]] -> [a]