
4 Jun
2010
4 Jun
'10
1:25 a.m.
On Jun 3, 2010, at 16:18 , Philip Scott wrote:
that if you replace the 'if' line with
if (B.null bs || i== -1) then return 1
(i never equals -1) then it runs in constant space! That just boggles my mind.
That's your clue: since adding i there makes it run in constant space, you must be forcing its evaluation when it otherwise was just building thunks. So you need to make i strict with seq or case. -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH