[Haskell-cafe] groupBy without Ord?

martin martin.drautzburg at web.de
Sun Mar 30 19:47:18 UTC 2014


Am 03/30/2014 06:00 PM, schrieb Kim-Ee Yeoh:
> 
> On Sun, Mar 30, 2014 at 9:06 PM, martin <martin.drautzburg at web.de <mailto:martin.drautzburg at web.de>> wrote:
> 
>     groupEq (x:xs) = (groupEq a) ++ [x] ++ (groupEq b)
>             where
>                 a = filter (==x) xs
>                 b = filter (/= x) xs
> 
> 
> Why the need to recurse on "a"? It's a list of identical elements!

Silly me. I had just mechanically modified the textbook quicksort.



More information about the Haskell-Cafe mailing list