reading from file

2002-01-22 Thread S.D.Mechveliani
Who would tell me, please, what is the simplest way to read a string from a file? Namely, what has one to set in place of `...' in the program main = putStr (...) to obtain instead of `...' a string contained in the file foo.txt ? Thank you in advance for the help.

Re: reading from file

2002-01-22 Thread Mark Carroll
On Tue, 22 Jan 2002, S.D.Mechveliani wrote: Who would tell me, please, what is the simplest way to read a string from a file? Namely, what has one to set in place of `...' in the program main = putStr (...) to obtain instead of `...' a string contained in the file

Fast Reading from File

2001-04-09 Thread Saswat Anand
I have a need to read large lists of numbers from a file and operate on them. I tried the following: read' =do s - readFile "temp" print $ sum $ map (fst.head.readDec)(lines s) But this is quite slow even for 1000 numbers. Are there any other ways to do it faster? Will it help