<div dir="ltr"><div>I want to read a text file, and store it in a <b>String</b>. But readFile will get <b>IO String</b>. 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?<br>
<br></div>In fact, I want to read a file and split it into <b>[String]</b> with <b>lines</b> function. Here is what I have tried. <a href="https://github.com/eccstartup/findDict/blob/master/src/Data/Dict/Utils.hs">link</a> I think I could directly operate on <b>[String]</b>. But it is not true for me.<br>
<div><br><br>[1] <a href="http://www.haskell.org/hoogle/?hoogle=IO+String+-%3E+String">http://www.haskell.org/hoogle/?hoogle=IO+String+-%3E+String</a><br><br><br></div><div>Yi Lu<br></div></div>