On Thu, Jun 9, 2011 at 11:31 AM, Max Bolingbroke <span dir="ltr">&lt;<a href="mailto:batterseapower@hotmail.com">batterseapower@hotmail.com</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
If you want plain text serialization, &quot;writeFile &quot;output.txt&quot; . show&quot;<br>
and &quot;fmap read (readFile &quot;output.txt&quot;)&quot; should suffice...<br>
<br>
Max<br>
<div><div></div><div class="h5"><br></div></div></blockquote><div><br>This code works:<br><br>main = do<br>     let xss = [[1,2,3],[4,5,6],[7,8],[9]]<br>     writeFile &quot;output.txt&quot; (show xss)<br>     line &lt;- readFile &quot;output.txt&quot;<br>
     let xss2 = read line :: [[Int]] <br>     print xss2<br> <br></div>As soon as complete file is returned as a single line, using &#39;fmap&#39;  does not make sense here:  <br>     line &lt;- readFile &quot;output.txt&quot;<br>
     let xss2 = fmap read line<br><br> When to use &#39;fmap&#39;?<br>
</div>