I want to read a text file, and store it in a *String*. But readFile will
get *IO String*. I search with google and they tell me it is not
necessarily to do so. Can you explain to me why is this? Furthermore, How
to read a file and store it in a String?
In fact, I want to read a file and split it
On Wed, Sep 4, 2013 at 10:21 AM, yi lu zhiwudazhanjiang...@gmail.comwrote:
I want to read a text file, and store it in a *String*. But readFile will
get *IO String*. I search with google and they tell me it is not
necessarily to do so. Can you explain to me why is this? Furthermore, How
to
On Wed, Sep 04, 2013 at 10:21:37PM +0800, yi lu wrote:
I want to read a text file, and store it in a *String*. But readFile will
get *IO String*. I search with google and they tell me it is not
necessarily to do so. Can you explain to me why is this? Furthermore, How
to read a file and store
The original poster wants to
- read a file
- get the contents as a String
- break the string into lines
- do something with the lines
- and presumably print the result
Easy. Put the following lines in a file called 'rf.hs':
file_name = rf.hs
main =
readFile file_name = \string -