> That's not what I had in mind: Given the Glorious FFI lib, Addr would
> be much better than MutableByteArrays,
I'm not really participating in this discussion, but this point struck me as
odd. Why should one use Addr rather than (Mutable)ByteArray?
- because Addrs don't move, so you can
safely pass them to foreign imports that
might re-enter Haskell.
why should one use (Mutable)ByteArray?
- because they are cheaper to allocate
and free to garbage collect, and you
don't need to explicitly release the
storage.
So it's not always clear cut.
> and both are one-liners with
> foreign import + Posix's read/write. What I want is
Hmmm. Posix's read and write (presumably you mean fdRead and fdWrite)
aren't thread-friendly, don't do any buffering, and don't work with Handles.
Cheers,
Simon