[Haskell-cafe] groupBy without Ord?

Kim-Ee Yeoh ky3 at atamo.com
Sun Mar 30 16:00:19 UTC 2014


On Sun, Mar 30, 2014 at 9:06 PM, martin <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!



-- Kim-Ee
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20140330/66ac6305/attachment.html>


More information about the Haskell-Cafe mailing list