seq / strictness and laziness

Olaf Chitil olaf@cs.york.ac.uk
Mon, 12 Nov 2001 16:45:49 +0000


Amanda Clare wrote:
> 
> Dean Herington wrote:
> >
> > `seq` forces evaluation of only the top-level construct in its first
> > argument.  (($!) similarly for its second argument.)  I would guess your
> > "newcounts" are structured (probably a tuple or list), in which case you are
> > not forcing evaluation deeply enough.  See
> > http://haskell.org/pipermail/haskell/2001-August/001581.html and followup
> > article.
> 
> Thanks, that's just what I need. It works! 

Then using a data type with strict data constructor arguments together
with ($!) in return should also work.

Olaf

-- 
OLAF CHITIL, 
 Dept. of Computer Science, University of York, York YO10 5DD, UK. 
 URL: http://www.cs.york.ac.uk/~olaf/
 Tel: +44 1904 434756; Fax: +44 1904 432767