<div dir="ltr">Thank you Tom, Niklas, Nicolas and Stuart,<div>Calculating the length was just an illustration - what I really need to do is parse the file. Anyway, it is clear that String for IO is a bad idea - I wonder if examples of String based readFile etc for beginners is a good idea or not.</div>

<div>Regards,</div><div>Kashyap</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jun 24, 2014 at 10:44 PM, Tom Ellis <span dir="ltr"><<a href="mailto:tom-lists-haskell-cafe-2013@jaguarpaw.co.uk" target="_blank">tom-lists-haskell-cafe-2013@jaguarpaw.co.uk</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On Tue, Jun 24, 2014 at 10:37:35PM +0530, C K Kashyap wrote:<br>
> Thanks Nicholas :) ... and if I understand right doing `seq` would be<br>
> equivalent to Strict IO that Darren mentioned. right?<br>
<br>
</div>It's probably best to think of them as distinct.<br>
<br>
Strict IO roughly means the whole file will be read at once so the file<br>
handle can be released.  On the other hand `seq`ing the `length` forces the<br>
calculation of the length so the file is read completely and the file handle<br>
can be released.  They have similar outcomes but the means of achieving them<br>
is different.<br>
<span class="HOEnZb"><font color="#888888"><br>
Tom<br>
</font></span><div class="HOEnZb"><div class="h5">_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
</div></div></blockquote></div><br></div>