mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-18 09:19:32 -06:00
First version of SRGS with semantic tags.
This commit is contained in:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user