1
0
Fork 0
mirror of https://code.sup39.dev/repos/Wqawg synced 2024-12-28 22:34:50 +09:00

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
-- first element. Returns a list of pairs, where each pair corresponds to one
-- such range.
groupByFst :: Eq a => [(a, b)] -> [(a, [b])]
groupByFst [] = []
groupByFst ((x, y):ps) =
let (same, rest) = span ((== x) . fst) ps
in (x, y : map snd same) : groupByFst rest
--groupByFst :: Eq a => [(a, b)] -> [(a, [b])]
--groupByFst [] = []
--groupByFst ((x, y):ps) =
-- let (same, rest) = span ((== x) . fst) ps
-- in (x, y : map snd same) : groupByFst rest
-- | Group together sublists of Just items, and drop the Nothing items.
--