|
|
Hello Johan,
Friday, May 23, 2008, 5:58:04 PM, you wrote:
>> cs <- hGetLine out
>> hClose out
>> print cs
>>
> I think you need to either print cs before you close the socket or
> make sure that cs is force (~computed) before you close the socket as
> laziness makes it get evaluated when you call print cs rather than
> when you call hGetLine. In other words, you try to read from the
> socket after you've closed it.
hGetLine, unlike hGetContents, has a strict semantics. actually,
hGetContents is only lazy i/o operation, everything else (hGetChar,
hGetBuf, hGetArray) is strict
--
Best regards,
Bulat mailto:Bulat.Ziganshin@xxxxxxxxx
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@xxxxxxxxxxx
http://www.haskell.org/mailman/listinfo/haskell-cafe
|
|