Felipe Almeida Lessa wrote:
On 6/8/07, Simon Marlow <[EMAIL PROTECTED]> wrote:
The problem occurs when you've found the Nothing, but the rest of the
list has
already been sparked. You really want to throw away all those sparks,
but
there's no way to do that currently. One way you could improve the
situation
though is to only spark the next N elements in the list, limiting the
amount of
speculation.
I see. I was hoping that GHC would see that the sparked thunk could be
garbage collected (as the rest of the list with sparks was thrown
away) and would not force it. It is expensive to GC before starting
every spark, of course, but maybe the GC could look for sparks that
could be removed whenever it collects?
Actually at the moment the GC treats sparks as roots, but that's wrong. Thanks
for reminding me, I must fix that sometime.
Cheers,
Simon
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe