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

Hi,
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? Thanks Neil

Hello Matt, Friday, September 29, 2006, 10:31:10 AM, you wrote:
I would like a non-lazy alternative to
readFile
is there such a thing in the libraries?
i recommend you to use readFile from FPS library. it's strict (unles you use Lazy module) and then you can either use returned ByteString directly with a plenty of supported operations, or convert it to String using unpack. it will be faster than solution by Neil -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com

Cheers mate, That was exactly what I was looking for matt On 02/10/2006, at 4:18 PM, Bulat Ziganshin wrote:
Hello Matt,
Friday, September 29, 2006, 10:31:10 AM, you wrote:
I would like a non-lazy alternative to
readFile
is there such a thing in the libraries?
i recommend you to use readFile from FPS library. it's strict (unles you use Lazy module) and then you can either use returned ByteString directly with a plenty of supported operations, or convert it to String using unpack. it will be faster than solution by Neil
-- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com
participants (3)
-
Bulat Ziganshin
-
Matt Roberts
-
Neil Mitchell