| Safe Haskell | None |
|---|---|
| Language | Haskell98 |
Data.Repa.Array.Material.Foreign
Contents
- 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.
Constructors
| Foreign | |
Fields
| |
Instances
| Eq F | |
| Show F | |
| Layout F | Foreign arrays. |
| Storable a => Bulk F a | Foreign arrays. |
| Storable a => Windowable F a | Windowing Foreign arrays. |
| Storable a => Target F a | Foreign buffers |
| Convert F Char A Char | |
| Convert F Double A Double | |
| Convert F Float A Float | |
| Convert F Int A Int | |
| Convert F Int8 A Int8 | |
| Convert F Int16 A Int16 | |
| Convert F Int32 A Int32 | |
| Convert F Int64 A Int64 | |
| Convert F Word8 A Word8 | |
| Convert A Char F Char | |
| Convert A Double F Double | |
| Convert A Float F Float | |
| Convert A Int F Int | |
| Convert A Int8 F Int8 | |
| Convert A Int16 F Int16 | |
| Convert A Int32 F Int32 | |
| Convert A Int64 F Int64 | |
| Convert A Word8 F Word8 | |
| Eq (Name F) | |
| Show (Name F) | |
| (Eq a, Storable a) => Eq (Array F a) | |
| (Storable a, Show a) => Show (Array F a) | |
| Unpack (Array F a) (Vector a) | |
| Unpack (Buffer F a) (IOVector a) | Unpack Foreign buffers |
| data Name F = F | |
| type Index F = Int | |
| data Array F = FArray !(Vector a) | |
| data Buffer F = FBuffer !(IOVector a) |
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.