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:
parent
7782e83419
commit
c8146bbff4
1 changed files with 5 additions and 5 deletions
|
@ -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.
|
||||
--
|
||||
|
|
Loading…
Reference in a new issue