mirror of
https://code.sup39.dev/repos/Wqawg
synced 2024-12-31 04:44:51 +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
|
-- | 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.
|
||||||
--
|
--
|
||||||
|
|
Loading…
Reference in a new issue