[Haskell-cafe] non lazy io

Neil Mitchell ndmitchell at gmail.com
Sun Oct 1 19:17:23 EDT 2006


> I would like a non-lazy alternative to
> readFile
> is there such a thing in the libraries?

Not as far as I know, but you can achieve something similar by doing:

-- untested
readFile' file = do
   src <- readFile file
   return $ seq (length src) src

What is the particular reason you want a strict readFile for?



More information about the Haskell-Cafe mailing list