On Tue, 9 Jun 2009, Cale Gibbard wrote:

Similarly, groupBy f xs is (and should be) the unique list of
contiguous sublists of xs such that:
1) concat (groupBy f xs) = xs
2) If x is the head of any of the sublists and y is any other element
of that sublist, then f x y
3) The sequence of lengths of the sublists is lexicographically
maximum for all lists satisfying the first two properties (That is, it
always prefers adding elements to an earlier group to starting a new
group.)

groupBy defined this way was found to be inappropriate for many cases, like grouping a list into increasing sequences using groupBy (<=). Other cases can be found in Haskell-Cafe or librar...@haskell.org.
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to