From bdf602b95c1deb816cd48eb44a4a0a782b6193ea Mon Sep 17 00:00:00 2001 From: bringert Date: Wed, 1 Feb 2006 19:00:48 +0000 Subject: SRGS: add top-level rules for each GF category. --- src/GF/Data/Utilities.hs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/GF/Data') 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. -- cgit v1.2.3