[Haskell] the wonders of lazy IO

Cale Gibbard cgibbard at gmail.com
Tue Apr 19 01:19:52 EDT 2005


> Well, not quite.  ($!) (like `seq`, out of which it's built) forces
> evaluation only to "weak head normal form": essentially enough to
> determine the top-level constructor.  Here, for String, that means
> only the first character need be evaluated, which in practice means
> only the first bufferful of the file is read.  You need to use ($!!)
> or something like it to force evaluation of the entire file contents.
> [See http://www.mail-archive.com/haskell@haskell.org/msg15819.html.]
> 
> Dean
> 

Ah, good point, I missed that.


More information about the Haskell mailing list