[Haskell-cafe] Need help - my haskell code is over 50 times slower than equivalent perl implementation
C K Kashyap
ckkashyap at gmail.com
Wed Jun 25 01:56:43 UTC 2014
Thank you Tom, Niklas, Nicolas and Stuart,
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.
On Tue, Jun 24, 2014 at 10:44 PM, Tom Ellis <
tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk> wrote:
> On Tue, Jun 24, 2014 at 10:37:35PM +0530, C K Kashyap wrote:
> > Thanks Nicholas :) ... and if I understand right doing `seq` would be
> > equivalent to Strict IO that Darren mentioned. right?
> It's probably best to think of them as distinct.
> Strict IO roughly means the whole file will be read at once so the file
> handle can be released. On the other hand `seq`ing the `length` forces the
> calculation of the length so the file is read completely and the file
> can be released. They have similar outcomes but the means of achieving
> is different.
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe