[Haskell-beginners] A first try
David Place
d at vidplace.com
Mon Jun 27 14:47:53 CEST 2011
On Jun 27, 2011, at 8:33 AM, Yitzchak Gale wrote:
> David Place wrote:
>> Suppose the file is only partially demanded as in the case I quoted earlier.
>>
>> print10 =
>> do
>> contents <- withFile "/usr/share/dict/words" ReadMode (\h -> hGetContents h)
>> print $ take 10 contents
>>
>> The file would never be closed.
>
> I tried it - it does close the file.
>
> Thanks,
> Yitz
II'm not sure what you mean. Did you create a new version of withFile that behaves as Heinrich suggested? If so, please post its definition.
____________________
David Place
Owner, Panpipes Ho! LLC
http://panpipesho.com
d at vidplace.com
More information about the Beginners
mailing list