On 1/4/07, Stefan Karrmann <[EMAIL PROTECTED]> wrote:
My 2 cent:
Why does seq not help? See code below.
The short answer is because it only forces the head of the value, not
the entire value. You need deepSeq for that.
load fn = do handle <- IO.openFile fn IO.ReadMode
contents <- IO.hGetContents handle
let len = length contents
seq len $ IO.hClose handle
return $ XP.xmlParse fn contents
This works, because to get the head of len (an integer) you need the
whole of contents.
--
Taral <[EMAIL PROTECTED]>
"You can't prove anything."
-- Gödel's Incompetence Theorem
_______________________________________________
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell