6 Jan
2007
6 Jan
'07
6:15 p.m.
On 1/4/07, Stefan Karrmann <S.Karrmann@web.de> 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 <taralx@gmail.com> "You can't prove anything." -- Gödel's Incompetence Theorem