Copyright | (c) Alexey Kuleshevich 2018 |
---|---|
License | BSD3 |
Maintainer | Alexey Kuleshevich <lehins@yandex.ru> |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
Manifest
General Manifest representation
Index ix => Manifest M ix e Source # | |
(Index ix, Index (Lower ix), (~) * (Elt M ix e) (Array M (Lower ix) e)) => Slice M ix e Source # | |
Slice M Ix1 e Source # | |
((~) * (Elt M ix e) (Array M (Lower ix) e), Index ix, Index (Lower ix)) => InnerSlice M ix e Source # | |
InnerSlice M Ix1 e Source # | |
((~) * (Elt M ix e) (Array M (Lower ix) e), Index ix, Index (Lower ix)) => OuterSlice M ix e Source # | |
OuterSlice M Ix1 e Source # | |
Index ix => Load M ix e Source # | |
Index ix => Source M ix e Source # | |
Index ix => Size M ix e Source # | |
Index ix => Construct M ix e Source # | |
Index ix => Foldable (Array M ix) Source # | Row-major sequential folding over a Manifest array. |
data Array M Source # | |
type EltRepr M ix Source # | |
Boxed
Array representation for Boxed elements. This structure is element and spine strict, but elements are strict to Weak Head Normal Form (WHNF) only.
Show B Source # | |
Index ix => Mutable B ix e Source # | |
Index ix => Manifest B ix e Source # | |
(NFData e, Index ix, Index (Lower ix), (~) * (Elt M ix e) (Array M (Lower ix) e), (~) * (Elt B ix e) (Array M (Lower ix) e)) => InnerSlice B ix e Source # | |
(NFData e, Index ix, Index (Lower ix), (~) * (Elt M ix e) (Array M (Lower ix) e), (~) * (Elt B ix e) (Array M (Lower ix) e)) => OuterSlice B ix e Source # | |
Index ix => Source B ix e Source # | |
Index ix => Size B ix e Source # | |
Index ix => Construct B ix e Source # | |
Index ix => Foldable (Array B ix) Source # | Row-major sequential folding over a Boxed array. |
(IsList (Array L ix e), Nested LN ix e, Nested L ix e, Ragged L ix e) => IsList (Array B ix e) Source # | |
(Index ix, Eq e) => Eq (Array B ix e) Source # | |
(Index ix, NFData e) => NFData (Array B ix e) Source # | |
data Array B Source # | |
type VRepr B Source # | |
data MArray s B Source # | |
type EltRepr B ix Source # | |
type Item (Array B ix e) Source # | |
Array representation for Boxed elements. This structure is element and
spine strict, and elements are always in Normal Form (NF), therefore NFData
instance is required.
Show N Source # | |
(Index ix, NFData e) => Mutable N ix e Source # | |
(Index ix, NFData e) => Manifest N ix e Source # | |
(NFData e, Index ix, Index (Lower ix), (~) * (Elt M ix e) (Array M (Lower ix) e), (~) * (Elt N ix e) (Array M (Lower ix) e)) => InnerSlice N ix e Source # | |
(NFData e, Index ix, Index (Lower ix), (~) * (Elt M ix e) (Array M (Lower ix) e), (~) * (Elt N ix e) (Array M (Lower ix) e)) => OuterSlice N ix e Source # | |
(Index ix, NFData e) => Source N ix e Source # | |
(Index ix, NFData e) => Size N ix e Source # | |
(Index ix, NFData e) => Construct N ix e Source # | |
(NFData e, IsList (Array L ix e), Nested LN ix e, Nested L ix e, Ragged L ix e) => IsList (Array N ix e) Source # | |
(Index ix, NFData e, Eq e) => Eq (Array N ix e) Source # | |
(Index ix, NFData e) => NFData (Array N ix e) Source # | |
data Array N Source # | |
type VRepr N Source # | |
data MArray s N Source # | |
type EltRepr N ix Source # | |
type Item (Array N ix e) Source # | |
Primitive
Representation for Prim
itive elements
Class of types supporting primitive array operations
Storable
Representation for Storable
elements
Show S Source # | |
(Index ix, Storable e) => Mutable S ix e Source # | |
(Index ix, Storable e) => Manifest S ix e Source # | |
(Storable e, Index ix, Index (Lower ix), (~) * (Elt M ix e) (Array M (Lower ix) e), (~) * (Elt S ix e) (Array M (Lower ix) e)) => InnerSlice S ix e Source # | |
(Storable e, Index ix, Index (Lower ix), (~) * (Elt M ix e) (Array M (Lower ix) e), (~) * (Elt S ix e) (Array M (Lower ix) e)) => OuterSlice S ix e Source # | |
(Storable e, Index ix) => Source S ix e Source # | |
(Storable e, Index ix) => Size S ix e Source # | |
(Storable e, Index ix) => Construct S ix e Source # | |
(Storable e, IsList (Array L ix e), Nested LN ix e, Nested L ix e, Ragged L ix e) => IsList (Array S ix e) Source # | |
(Storable e, Eq e, Index ix) => Eq (Array S ix e) Source # | |
(Index ix, NFData e) => NFData (Array S ix e) Source # | |
data Array S Source # | |
type VRepr S Source # | |
data MArray s S Source # | |
type EltRepr S ix Source # | |
type Item (Array S ix e) Source # | |
The member functions of this class facilitate writing values of primitive types to raw memory (which may have been allocated with the above mentioned routines) and reading values from blocks of raw memory. The class, furthermore, includes support for computing the storage requirements and alignment restrictions of storable types.
Memory addresses are represented as values of type
, for some
Ptr
aa
which is an instance of class Storable
. The type argument to
Ptr
helps provide some valuable type safety in FFI code (you can't
mix pointers of different types without an explicit cast), while
helping the Haskell type system figure out which marshalling method is
needed for a given pointer.
All marshalling between Haskell and a foreign language ultimately
boils down to translating Haskell data structures into the binary
representation of a corresponding data structure of the foreign
language and vice versa. To code this marshalling in Haskell, it is
necessary to manipulate primitive data types stored in unstructured
memory blocks. The class Storable
facilitates this manipulation on
all types for which it is instantiated, which are the standard basic
types of Haskell, the fixed size Int
types (Int8
, Int16
,
Int32
, Int64
), the fixed size Word
types (Word8
, Word16
,
Word32
, Word64
), StablePtr
, all types from Foreign.C.Types,
as well as Ptr
.
sizeOf, alignment, (peek | peekElemOff | peekByteOff), (poke | pokeElemOff | pokeByteOff)
Unboxed
Representation for Unbox
ed elements
class (Vector Vector a, MVector MVector a) => Unbox a #
Unbox Bool | |
Unbox Char | |
Unbox Double | |
Unbox Float | |
Unbox Int | |
Unbox Int8 | |
Unbox Int16 | |
Unbox Int32 | |
Unbox Int64 | |
Unbox Word | |
Unbox Word8 | |
Unbox Word16 | |
Unbox Word32 | |
Unbox Word64 | |
Unbox () | |
Unbox Ix2 # | Unboxing of a |
Unbox a => Unbox (Complex a) | |
((<=) 3 n, Unbox (Ix ((-) n 1))) => Unbox (IxN n) # | Unboxing of a |
(Unbox a, Unbox b) => Unbox (a, b) | |
(Unbox a, Unbox b, Unbox c) => Unbox (a, b, c) | |
(Unbox a, Unbox b, Unbox c, Unbox d) => Unbox (a, b, c, d) | |
(Unbox a, Unbox b, Unbox c, Unbox d, Unbox e) => Unbox (a, b, c, d, e) | |
(Unbox a, Unbox b, Unbox c, Unbox d, Unbox e, Unbox f) => Unbox (a, b, c, d, e, f) | |