27 Aug
2006
27 Aug
'06
1:45 p.m.
Hello L.,
Sunday, August 27, 2006, 12:43:24 PM, you wrote:
length s `seq` writeFile f ("hello"++s)
length mates_str `seq` return ()
it's the same. i recommend you to use:
return $! tail mates_str
$! defined as
f$!x = x `seq` f x
'tail' should be slightly faster than 'len'
-- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com
But you need to evaluate the result of readFile all the way to the end--you need to use a function that traverses the entire file contents. Otherwise the file will be left open to read the bit you haven't traversed. Hence length rather than tail. John