spool

Convert between ByteString and Vector.Storable without copying

Latest on Hackage:0.1

See all snapshots spool appears in

BSD-3-Clause licensed and maintained by Keegan McAllister

Module documentation for 0.1

This version can be pinned in stack with:spool-0.1@sha256:77780cbfc2c0be23ff2ea9e474062f3df97fcd9db946ee0b3508280a923b83e2,1461

This library allows conversion between the types from Data.ByteString (package bytestring) and Data.Vector.Storable (package vector) without copying the underlying data. This is useful, for example, when ByteString IO produces or consumes vectors of numbers in native byte order.

This trick relies on the fact that ByteString and Vector use their respective ForeignPtrs in compatible ways. It works with bytestring-0.9.1.10 and vector-0.9 on GHC 7.0. It may break with future releases of these packages. Depending on this library should be seen as a way to document and standardize an existing hack, and not as an absolute guarantee of correct behavior.

Used by 3 packages in lts-9.21(full list with versions):