| storablevector-0.2.1: Fast, packed, strict storable arrays with a list interface like ByteString | Source code | Contents | Index |
|
|
|
|
|
Description |
A module containing semi-public StorableVector internals. This exposes
the StorableVector representation and low level construction functions.
Modules which extend the StorableVector system will need to use this module
while ideally most users will be able to make do with the public interface
modules.
|
|
Synopsis |
|
|
|
|
The Vector type and representation
|
|
|
A space-efficient representation of a vector, supporting many efficient
operations.
Instances of Eq, Ord, Read, Show, Data, Typeable
| Constructors | | Instances | |
|
|
Unchecked access
|
|
|
A variety of head for non-empty Vectors. unsafeHead omits the
check for the empty case, so there is an obligation on the programmer
to provide a proof that the Vector is non-empty.
|
|
|
A variety of tail for non-empty Vectors. unsafeTail omits the
check for the empty case. As with unsafeHead, the programmer must
provide a separate proof that the Vector is non-empty.
|
|
|
A variety of last for non-empty Vectors. unsafeLast omits the
check for the empty case, so there is an obligation on the programmer
to provide a proof that the Vector is non-empty.
|
|
|
A variety of init for non-empty Vectors. unsafeInit omits the
check for the empty case. As with unsafeLast, the programmer must
provide a separate proof that the Vector is non-empty.
|
|
|
Unsafe Vector index (subscript) operator, starting from 0, returning a
single element. This omits the bounds check, which means there is an
accompanying obligation on the programmer to ensure the bounds are checked in
some other way.
|
|
|
A variety of take which omits the checks on n so there is an
obligation on the programmer to provide a proof that 0 <= n <= length xs.
|
|
|
A variety of drop which omits the checks on n so there is an
obligation on the programmer to provide a proof that 0 <= n <= length xs.
|
|
Low level introduction and elimination
|
|
|
Wrapper of mallocForeignPtrArray.
|
|
|
Given the maximum size needed and a function to make the contents
of a Vector, createAndTrim makes the Vector. The generating
function is required to return the actual final size (<= the maximum
size), and the resulting byte array is realloced to this size.
createAndTrim is the main mechanism for creating custom, efficient
Vector functions, using Haskell or C functions to fill the space.
|
|
|
|
|
A way of creating Vectors outside the IO monad. The Int
argument gives the final size of the Vector. Unlike
createAndTrim the Vector is not reallocated if the final size
is less than the estimated size.
|
|
|
O(1) Build a Vector from a ForeignPtr
|
|
|
O(1) Deconstruct a ForeignPtr from a Vector
|
|
|
Just like unsafePerformIO, but we inline it. Big performance gains as
it exposes lots of things to further inlining. Very unsafe. In
particular, you should do no memory allocation inside an
inlinePerformIO block. On Hugs this is just unsafePerformIO.
|
|
Produced by Haddock version 2.4.2 |