GHC.Prim.ByteArray# - confusing documentation

Antoine Latter aslatter at gmail.com
Sat Dec 26 17:25:27 EST 2009


On Sat, Dec 26, 2009 at 12:50 PM, Duncan Coutts
<duncan.coutts at googlemail.com> wrote:
>
> It's been on my TODO list for some time to design a portable low level
> ByteArray module that could be implemented by hugs, nhc, ghc, etc. The
> aim would be to be similar to ForeignPtr + Storable but using native
> heap allocated memory blocks.
>

It looks like Data.Text.Array has a bit of a head-start on this,
although it sounds like you're looking for something even simpler.
Currently it only apears to build on GHC and Hugs, but we could have
an FFI fall-back case.

I prefer the interface to Data.Primitive.ByteArray, though.

> In turn this would be the right portable layer on which to build
> ByteString, Text and probably IO buffers too.

It looks like ByteString is aggressive about calling C code to perform
a few operations - which is something we'd only be able to do for
pined arrays.

Antoine


More information about the Glasgow-haskell-users mailing list