[Haskell-cafe] Shouldn't this be lazy???
marco-oweber at gmx.de
Fri Jun 22 12:24:12 EDT 2007
> It does the job, but for the tests I just wanted to take 10 links to
> reduce the time the program runs. Just hoping that haskell laziness
> would magically take the minimum amount of data required to get the
> first 10 links out of this set of pages.
I haven't read the details of the post. But I think its due to lazy
operations not beeing lazy by default.
Have a look at this thread it might help
All which is done is throwing in a unsafeInterleaveIO at some locations.
Because I didn't want to implement all list functions again I had the
idea of inventing the LazyIO monad (which calls unsafeInterleaveIO
automatically) But doing this to often resulted in no list processing at
I hope that this gives you a hint to look more stuff up on the wiki
using the search etc.
If this didn't help post again and I'll have a closer look.
More information about the Haskell-Cafe