[Haskell-cafe] Double free-ing

Ketil Malde ketil at malde.org
Fri Dec 18 02:29:08 EST 2009

Mitar <mmitar at gmail.com> writes:

> I checked ByteString's hGetNonBlocking now and I do see why it is
> still better to use System.IO's hGetBufNonBlocking.

> [...] But with hGetNonBlocking I would have to append two different
> buffers to get a resulting buffer, what is completely unnecessary
> O(n).

Lazy ByteStrings should be able to append with O(1).  (Or use strict BS
hGetNonBlocking, and Lazy ByteString fromChunks.)

If I haven't seen further, it is by standing in the footprints of giants

More information about the Haskell-Cafe mailing list