[Haskell-cafe] Efficiency question

Henning Thielemann lemming at henning-thielemann.de
Wed May 30 08:46:44 EDT 2007


On Sun, 27 May 2007, Evil Bro wrote:

> I'm pretty new to Haskell, so forgive me if my question is due to my
> non-functional way of thinking...
>
> I have the following code:

Counting can be done elegantly by 'filter' and 'length':

length $ filter (>1) $ Monad.liftM2 gcd [2..1000] [2..1000]


More information about the Haskell-Cafe mailing list