[Haskell-cafe] How to read a file and return a String?
zhiwudazhanjiangshi at gmail.com
Wed Sep 4 16:21:37 CEST 2013
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 into *[String]* with
*lines*function. Here is what I have tried.
think I could directly operate on
*[String]*. But it is not true for me.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe