Safe Haskell | None |
---|---|
Language | Haskell98 |
- data F = Foreign {
- foreignLength :: Int
- unsafeCast :: (Storable a, Storable b) => Array F a -> Array F b
- fromForeignPtr :: Storable a => Int -> ForeignPtr a -> Array F a
- toForeignPtr :: Storable a => Array F a -> (Int, Int, ForeignPtr a)
- fromStorableVector :: Vector a -> Array F a
- toStorableVector :: Array F a -> Vector a
- fromByteString :: ByteString -> Array F Word8
- toByteString :: Array F Word8 -> ByteString
Documentation
Layout for dense Foreign arrays.
UNSAFE: Indexing into raw material arrays is not bounds checked. You may want to wrap this with a Checked layout as well.
Eq F Source # | |
Show F Source # | |
Layout F Source # | Foreign arrays. |
Storable a => Bulk F a Source # | Foreign arrays. |
Storable a => Windowable F a Source # | Windowing Foreign arrays. |
Storable a => Target F a Source # | Foreign buffers |
Eq (Name F) Source # | |
Show (Name F) Source # | |
(Eq a, Storable a) => Eq (Array F a) Source # | |
(Storable a, Show a) => Show (Array F a) Source # | |
data Name F Source # | |
type Index F Source # | |
data Array F Source # | |
data Buffer F Source # | |
Format conversion
unsafeCast :: (Storable a, Storable b) => Array F a -> Array F b Source #
O(1). Cast a foreign array from one element type to another.
fromForeignPtr :: Storable a => Int -> ForeignPtr a -> Array F a Source #
O(1). Wrap a ForeignPtr
as an array.
toForeignPtr :: Storable a => Array F a -> (Int, Int, ForeignPtr a) Source #
O(1). Unwrap a ForeignPtr
from an array.
fromStorableVector :: Vector a -> Array F a Source #
O(1). Convert a storable Vector
to a foreign Array
toStorableVector :: Array F a -> Vector a Source #
O(1). Convert a foreign array to a storable Vector
.
fromByteString :: ByteString -> Array F Word8 Source #
O(1). Convert a ByteString
to an foreign Array
.
toByteString :: Array F Word8 -> ByteString Source #
O(1). Convert a foreign Vector
to a ByteString
.