[Haskell-cafe] Optimization problem

tpledger at ihug.co.nz tpledger at ihug.co.nz
Wed Sep 13 21:24:49 EDT 2006


Magnus Jonsson wrote:
[...]
> but your example fails on infinite lists
[...]
> take 2 $ snd $ head $ splitStreams (map (\x -> (0 ,x))
[1..])

Any approach, even sieving, will struggle with infinite
lists, won't it?

    (take 2 . snd . head . splitStreams) [(i, i) | i <-
[0..]]

Regards,
Tom


More information about the Haskell-Cafe mailing list