
6 Apr
2006
6 Apr
'06
4:55 p.m.
On Thu, Apr 06, 2006 at 12:06:53AM -0700, Andy Gill wrote:
Because deepSeq's cost to evaluate a list that will eventually be required is linear. The maximum number of deepSeq calls (and recursive calls) you can do over any structure is simply the number of nodes.
Consider:
foldr (\ a as -> deepSeq (a : as)) [] $ some list
With the bit ==> one deepSeq per cons, then we hit the 'is-pre- deepSeqd' bit. Without the bit ==> O(n^2)
Ah, I see, I was thinking of something else. unfortunatly, this scheme or any scheme with changes to the run-time representation will be impossible in jhc. there is no concept of WHNF or thunks, let alone a generic way to evaluate them at run time in GRIN. John -- John Meacham - ⑆repetae.net⑆john⑈