[Haskell-cafe] groupBy huh?

Jacek Generowicz jacek.generowicz at cern.ch
Fri Mar 4 07:33:18 CET 2011


On 2011 Mar 4, at 02:14, Brandon S Allbery KF8NH wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 3/3/11 20:09 , Jacek Generowicz wrote:
>>> 1 < 2 ok, same group
>>> 1 < 3 dito
>>> 1 < 2 dito
>>> Thus you get [[1,2,3,2]]
>>
>> OK, that works, but it seems like a strange choice ...
>
> Stability is often valued in functions like this:  the order of  
> elements is
> not altered.

I'm failing to see how the behaviour I expected would change the order  
of elements: the elements would still come out in exactly the same  
order, it is just the boundaries between the groups would be in  
different places.



More information about the Haskell-Cafe mailing list