diff options
| author | bringert <bringert@cs.chalmers.se> | 2006-02-01 19:00:48 +0000 |
|---|---|---|
| committer | bringert <bringert@cs.chalmers.se> | 2006-02-01 19:00:48 +0000 |
| commit | bdf602b95c1deb816cd48eb44a4a0a782b6193ea (patch) | |
| tree | a9ee4952d9696dd08c561e17d7dd057b7e6d8aaf /src/GF/Data | |
| parent | 8cd03874f6d048cd4512e2855a30254cdf66de65 (diff) | |
SRGS: add top-level rules for each GF category.
Diffstat (limited to 'src/GF/Data')
| -rw-r--r-- | src/GF/Data/Utilities.hs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/GF/Data/Utilities.hs b/src/GF/Data/Utilities.hs index c7e1600c3..e0ad08705 100644 --- a/src/GF/Data/Utilities.hs +++ b/src/GF/Data/Utilities.hs @@ -99,6 +99,11 @@ tableSet x y [] = [(x,y)] tableSet x y (p@(x',_):xs) | x' == x = (x,y):xs | otherwise = p:tableSet x y xs +-- | Group tuples by their first elements. +buildMultiMap :: Ord a => [(a,b)] -> [(a,[b])] +buildMultiMap = map (\g -> (fst (head g), map snd g) ) + . sortGroupBy (compareBy fst) + -- * equality functions -- | Use an ordering function as an equality predicate. |
