[Haskell-beginners] A first try

David Place d at vidplace.com
Mon Jun 27 16:51:03 CEST 2011


On Jun 27, 2011, at 9:58 AM, Manfred Lotz wrote:

>> To ensure that the entire file is read, you can seq on the length,
>> 
>>    xml <- U.hGetContents inh
>>    let content = parseXMLDoc xml
>>    length xml `seq` case content of ...
>> 
> 
> Thanks a lot for the suggestion. Works fine.
> 
> I only tried deepseq because my first try with seq 
> 
> let content = xml `seq` parseXMLDoc xml
> 
> didn't work. 
> 

You can call me squeamish, but using a pure function (length) for its side-effects seems kind of kludge-y.  :-)

____________________
David Place   
Owner, Panpipes Ho! LLC
http://panpipesho.com
d at vidplace.com






More information about the Beginners mailing list