Data.List.groupBy with non-transitive equality predicate

Thomas Schilling nominolo at googlemail.com
Wed Aug 29 16:41:58 EDT 2007


On 29 aug 2007, at 22.02, Henning Thielemann wrote:
>  Since
> the documentation doesn't tell which elements are actually compared it
> seems to assume that the comparison is commutative and transitive.  
> Maybe
> this point should be made clearer.

I'd say this should be an implicit requirement for Eq a, just like  
Monad a assumes the monad laws (or strongly suggests).  But I agree  
that could be made clearer.

>  Additionally I think that comparing neighbouring elements is a useful
> behaviour and I suggest an according variant of 'groupBy' for  
> Data.List.

I agree that this could be useful.

/ Thomas


More information about the Libraries mailing list