[Haskell-cafe] Stupid newbie question

Mike Gunter m at ryangunter.com
Fri Jan 5 23:59:16 EST 2007


>
> pps. I didn't explain why [1..1000000] works, but [1..] fails, because
> I don't know :) It's a bit suprising to me...

With [1..1000000], the generated values have to be tested against
1000000 as you go.  So, they get evaluated.  In the [1..] case,
they don't.

-m


More information about the Haskell-Cafe mailing list