[Haskell-cafe] nubBy seems broken in recent GHCs
Henning Thielemann
lemming at henning-thielemann.de
Wed Jun 10 05:16:57 EDT 2009
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 Libraries at haskell.org.
More information about the Libraries
mailing list