Data.List.Local: Comment out the unused groupByFst

This commit is contained in:
fr33domlover 2018-07-08 21:56:08 +00:00
parent 7782e83419
commit c8146bbff4

View file

@ -27,11 +27,11 @@ import Data.List.NonEmpty (NonEmpty (..), (<|))
-- | Takes a list of pairs and groups them by consecutive ranges with equal -- | Takes a list of pairs and groups them by consecutive ranges with equal
-- first element. Returns a list of pairs, where each pair corresponds to one -- first element. Returns a list of pairs, where each pair corresponds to one
-- such range. -- such range.
groupByFst :: Eq a => [(a, b)] -> [(a, [b])] --groupByFst :: Eq a => [(a, b)] -> [(a, [b])]
groupByFst [] = [] --groupByFst [] = []
groupByFst ((x, y):ps) = --groupByFst ((x, y):ps) =
let (same, rest) = span ((== x) . fst) ps -- let (same, rest) = span ((== x) . fst) ps
in (x, y : map snd same) : groupByFst rest -- in (x, y : map snd same) : groupByFst rest
-- | Group together sublists of Just items, and drop the Nothing items. -- | Group together sublists of Just items, and drop the Nothing items.
-- --