massiv-0.2.8.0: Massiv (Массив) is an Array Library.

Copyright(c) Alexey Kuleshevich 2018
LicenseBSD3
MaintainerAlexey Kuleshevich <lehins@yandex.ru>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Data.Massiv.Array.Manifest

Contents

Description

 
Synopsis

Manifest

class Source r ix e => Manifest r ix e Source #

Manifest arrays are backed by actual memory and values are looked up versus computed as it is with delayed arrays. Because of this fact indexing functions (!), (!?), etc. are constrained to manifest arrays only.

Minimal complete definition

unsafeLinearIndexM

Instances
Index ix => Manifest M ix e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Internal

Methods

unsafeLinearIndexM :: Array M ix e -> Int -> e Source #

(Unbox e, Index ix) => Manifest U ix e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Unboxed

Methods

unsafeLinearIndexM :: Array U ix e -> Int -> e Source #

(Index ix, Storable e) => Manifest S ix e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Storable

Methods

unsafeLinearIndexM :: Array S ix e -> Int -> e Source #

(Index ix, Prim e) => Manifest P ix e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Primitive

Methods

unsafeLinearIndexM :: Array P ix e -> Int -> e Source #

(Index ix, NFData e) => Manifest N ix e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

unsafeLinearIndexM :: Array N ix e -> Int -> e Source #

Index ix => Manifest B ix e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

unsafeLinearIndexM :: Array B ix e -> Int -> e Source #

toManifest :: Manifest r ix e => Array r ix e -> Array M ix e Source #

O(1) - Conversion of Manifest arrays to M representation.

data M Source #

General Manifest representation

Instances
Index ix => Manifest M ix e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Internal

Methods

unsafeLinearIndexM :: Array M ix e -> Int -> e Source #

(Index ix, Index (Lower ix), Elt M ix e ~ Array M (Lower ix) e) => Slice M ix e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Internal

Methods

unsafeSlice :: Array M ix e -> ix -> Sz ix -> Dim -> Maybe (Elt M ix e) Source #

Slice M Ix1 e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Internal

Methods

unsafeSlice :: Array M Ix1 e -> Ix1 -> Sz Ix1 -> Dim -> Maybe (Elt M Ix1 e) Source #

(Elt M ix e ~ Array M (Lower ix) e, Index ix, Index (Lower ix)) => InnerSlice M ix e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Internal

Methods

unsafeInnerSlice :: Array M ix e -> (Sz (Lower ix), Sz1) -> Int -> Elt M ix e Source #

InnerSlice M Ix1 e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Internal

Methods

unsafeInnerSlice :: Array M Ix1 e -> (Sz (Lower Ix1), Sz1) -> Int -> Elt M Ix1 e Source #

(Elt M ix e ~ Array M (Lower ix) e, Index ix, Index (Lower ix)) => OuterSlice M ix e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Internal

Methods

unsafeOuterSlice :: Array M ix e -> Int -> Elt M ix e Source #

outerLength :: Array M ix e -> Int Source #

OuterSlice M Ix1 e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Internal

Index ix => Load M ix e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Internal

Methods

loadS :: Monad m => Array M ix e -> (Int -> m e) -> (Int -> e -> m ()) -> m () Source #

loadP :: [Int] -> Array M ix e -> (Int -> IO e) -> (Int -> e -> IO ()) -> IO () Source #

loadArrayWithStride :: Monad m => Int -> (m () -> m ()) -> Stride ix -> Sz ix -> Array M ix e -> (Int -> m e) -> (Int -> e -> m ()) -> m () Source #

loadArray :: Monad m => Int -> (m () -> m ()) -> Array M ix e -> (Int -> m e) -> (Int -> e -> m ()) -> m () Source #

Index ix => Source M ix e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Internal

Methods

unsafeIndex :: Array M ix e -> ix -> e Source #

unsafeLinearIndex :: Array M ix e -> Int -> e Source #

Index ix => Size M ix e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Internal

Methods

size :: Array M ix e -> Sz ix Source #

unsafeResize :: Index ix' => Sz ix' -> Array M ix e -> Array M ix' e Source #

unsafeExtract :: ix -> Sz ix -> Array M ix e -> Array (EltRepr M ix) ix e Source #

Index ix => Construct M ix e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Internal

Methods

getComp :: Array M ix e -> Comp Source #

setComp :: Comp -> Array M ix e -> Array M ix e Source #

unsafeMakeArray :: Comp -> Sz ix -> (ix -> e) -> Array M ix e Source #

Index ix => Foldable (Array M ix) Source #

Row-major sequential folding over a Manifest array.

Instance details

Defined in Data.Massiv.Array.Manifest.Internal

Methods

fold :: Monoid m => Array M ix m -> m #

foldMap :: Monoid m => (a -> m) -> Array M ix a -> m #

foldr :: (a -> b -> b) -> b -> Array M ix a -> b #

foldr' :: (a -> b -> b) -> b -> Array M ix a -> b #

foldl :: (b -> a -> b) -> b -> Array M ix a -> b #

foldl' :: (b -> a -> b) -> b -> Array M ix a -> b #

foldr1 :: (a -> a -> a) -> Array M ix a -> a #

foldl1 :: (a -> a -> a) -> Array M ix a -> a #

toList :: Array M ix a -> [a] #

null :: Array M ix a -> Bool #

length :: Array M ix a -> Int #

elem :: Eq a => a -> Array M ix a -> Bool #

maximum :: Ord a => Array M ix a -> a #

minimum :: Ord a => Array M ix a -> a #

sum :: Num a => Array M ix a -> a #

product :: Num a => Array M ix a -> a #

(Eq e, Index ix) => Eq (Array M ix e) Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Internal

Methods

(==) :: Array M ix e -> Array M ix e -> Bool #

(/=) :: Array M ix e -> Array M ix e -> Bool #

(Ord e, Index ix) => Ord (Array M ix e) Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Internal

Methods

compare :: Array M ix e -> Array M ix e -> Ordering #

(<) :: Array M ix e -> Array M ix e -> Bool #

(<=) :: Array M ix e -> Array M ix e -> Bool #

(>) :: Array M ix e -> Array M ix e -> Bool #

(>=) :: Array M ix e -> Array M ix e -> Bool #

max :: Array M ix e -> Array M ix e -> Array M ix e #

min :: Array M ix e -> Array M ix e -> Array M ix e #

data Array M ix e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Internal

data Array M ix e = MArray {}
type EltRepr M ix Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Internal

type EltRepr M ix = M

Boxed

data B Source #

Array representation for Boxed elements. This structure is element and spine strict, but elements are strict to Weak Head Normal Form (WHNF) only.

Constructors

B 
Instances
Show B Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

showsPrec :: Int -> B -> ShowS #

show :: B -> String #

showList :: [B] -> ShowS #

Index ix => Mutable B ix e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

Associated Types

data MArray s B ix e :: Type Source #

Methods

msize :: MArray s B ix e -> Sz ix Source #

unsafeThaw :: PrimMonad m => Array B ix e -> m (MArray (PrimState m) B ix e) Source #

unsafeFreeze :: PrimMonad m => Comp -> MArray (PrimState m) B ix e -> m (Array B ix e) Source #

unsafeNew :: PrimMonad m => Sz ix -> m (MArray (PrimState m) B ix e) Source #

unsafeNewZero :: PrimMonad m => Sz ix -> m (MArray (PrimState m) B ix e) Source #

unsafeLinearRead :: PrimMonad m => MArray (PrimState m) B ix e -> Int -> m e Source #

unsafeLinearWrite :: PrimMonad m => MArray (PrimState m) B ix e -> Int -> e -> m () Source #

unsafeNewA :: Applicative f => ix -> WorldState -> f (WorldState, MArray RealWorld B ix e)

unsafeThawA :: Applicative m => Array B ix e -> WorldState -> m (WorldState, MArray RealWorld B ix e)

unsafeFreezeA :: Applicative m => Comp -> MArray RealWorld B ix e -> WorldState -> m (WorldState, Array B ix e)

unsafeLinearWriteA :: Applicative m => MArray RealWorld B ix e -> Int -> e -> WorldState -> m WorldState

Index ix => Manifest B ix e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

unsafeLinearIndexM :: Array B ix e -> Int -> 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 # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

unsafeInnerSlice :: Array B ix e -> (Sz (Lower ix), Sz1) -> Int -> Elt 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 # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

unsafeOuterSlice :: Array B ix e -> Int -> Elt B ix e Source #

outerLength :: Array B ix e -> Int Source #

Index ix => Source B ix e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

unsafeIndex :: Array B ix e -> ix -> e Source #

unsafeLinearIndex :: Array B ix e -> Int -> e Source #

Index ix => Size B ix e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

size :: Array B ix e -> Sz ix Source #

unsafeResize :: Index ix' => Sz ix' -> Array B ix e -> Array B ix' e Source #

unsafeExtract :: ix -> Sz ix -> Array B ix e -> Array (EltRepr B ix) ix e Source #

Index ix => Construct B ix e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

getComp :: Array B ix e -> Comp Source #

setComp :: Comp -> Array B ix e -> Array B ix e Source #

unsafeMakeArray :: Comp -> Sz ix -> (ix -> e) -> Array B ix e Source #

Index ix => Foldable (Array B ix) Source #

Row-major sequential folding over a Boxed array.

Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

fold :: Monoid m => Array B ix m -> m #

foldMap :: Monoid m => (a -> m) -> Array B ix a -> m #

foldr :: (a -> b -> b) -> b -> Array B ix a -> b #

foldr' :: (a -> b -> b) -> b -> Array B ix a -> b #

foldl :: (b -> a -> b) -> b -> Array B ix a -> b #

foldl' :: (b -> a -> b) -> b -> Array B ix a -> b #

foldr1 :: (a -> a -> a) -> Array B ix a -> a #

foldl1 :: (a -> a -> a) -> Array B ix a -> a #

toList :: Array B ix a -> [a] #

null :: Array B ix a -> Bool #

length :: Array B ix a -> Int #

elem :: Eq a => a -> Array B ix a -> Bool #

maximum :: Ord a => Array B ix a -> a #

minimum :: Ord a => Array B ix a -> a #

sum :: Num a => Array B ix a -> a #

product :: Num a => Array B ix a -> a #

(IsList (Array L ix e), Nested LN ix e, Nested L ix e, Ragged L ix e) => IsList (Array B ix e) Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

Associated Types

type Item (Array B ix e) :: Type #

Methods

fromList :: [Item (Array B ix e)] -> Array B ix e #

fromListN :: Int -> [Item (Array B ix e)] -> Array B ix e #

toList :: Array B ix e -> [Item (Array B ix e)] #

(Index ix, Eq e) => Eq (Array B ix e) Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

(==) :: Array B ix e -> Array B ix e -> Bool #

(/=) :: Array B ix e -> Array B ix e -> Bool #

(Index ix, Ord e) => Ord (Array B ix e) Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

compare :: Array B ix e -> Array B ix e -> Ordering #

(<) :: Array B ix e -> Array B ix e -> Bool #

(<=) :: Array B ix e -> Array B ix e -> Bool #

(>) :: Array B ix e -> Array B ix e -> Bool #

(>=) :: Array B ix e -> Array B ix e -> Bool #

max :: Array B ix e -> Array B ix e -> Array B ix e #

min :: Array B ix e -> Array B ix e -> Array B ix e #

(Index ix, NFData e) => NFData (Array B ix e) Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

rnf :: Array B ix e -> () #

data Array B ix e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

data Array B ix e = BArray {}
type VRepr B Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Vector

type VRepr B = Vector
data MArray s B ix e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

data MArray s B ix e = MBArray !ix !(MutableArray s e)
type EltRepr B ix Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

type EltRepr B ix = M
type Item (Array B ix e) Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

type Item (Array B ix e) = Item (Array L ix e)

data N 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.

Constructors

N 
Instances
Show N Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

showsPrec :: Int -> N -> ShowS #

show :: N -> String #

showList :: [N] -> ShowS #

(Index ix, NFData e) => Mutable N ix e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

Associated Types

data MArray s N ix e :: Type Source #

Methods

msize :: MArray s N ix e -> Sz ix Source #

unsafeThaw :: PrimMonad m => Array N ix e -> m (MArray (PrimState m) N ix e) Source #

unsafeFreeze :: PrimMonad m => Comp -> MArray (PrimState m) N ix e -> m (Array N ix e) Source #

unsafeNew :: PrimMonad m => Sz ix -> m (MArray (PrimState m) N ix e) Source #

unsafeNewZero :: PrimMonad m => Sz ix -> m (MArray (PrimState m) N ix e) Source #

unsafeLinearRead :: PrimMonad m => MArray (PrimState m) N ix e -> Int -> m e Source #

unsafeLinearWrite :: PrimMonad m => MArray (PrimState m) N ix e -> Int -> e -> m () Source #

unsafeNewA :: Applicative f => ix -> WorldState -> f (WorldState, MArray RealWorld N ix e)

unsafeThawA :: Applicative m => Array N ix e -> WorldState -> m (WorldState, MArray RealWorld N ix e)

unsafeFreezeA :: Applicative m => Comp -> MArray RealWorld N ix e -> WorldState -> m (WorldState, Array N ix e)

unsafeLinearWriteA :: Applicative m => MArray RealWorld N ix e -> Int -> e -> WorldState -> m WorldState

(Index ix, NFData e) => Manifest N ix e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

unsafeLinearIndexM :: Array N ix e -> Int -> 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 # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

unsafeInnerSlice :: Array N ix e -> (Sz (Lower ix), Sz1) -> Int -> Elt 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 # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

unsafeOuterSlice :: Array N ix e -> Int -> Elt N ix e Source #

outerLength :: Array N ix e -> Int Source #

(Index ix, NFData e) => Source N ix e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

unsafeIndex :: Array N ix e -> ix -> e Source #

unsafeLinearIndex :: Array N ix e -> Int -> e Source #

(Index ix, NFData e) => Size N ix e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

size :: Array N ix e -> Sz ix Source #

unsafeResize :: Index ix' => Sz ix' -> Array N ix e -> Array N ix' e Source #

unsafeExtract :: ix -> Sz ix -> Array N ix e -> Array (EltRepr N ix) ix e Source #

(Index ix, NFData e) => Construct N ix e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

getComp :: Array N ix e -> Comp Source #

setComp :: Comp -> Array N ix e -> Array N ix e Source #

unsafeMakeArray :: Comp -> Sz ix -> (ix -> e) -> Array 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 # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

Associated Types

type Item (Array N ix e) :: Type #

Methods

fromList :: [Item (Array N ix e)] -> Array N ix e #

fromListN :: Int -> [Item (Array N ix e)] -> Array N ix e #

toList :: Array N ix e -> [Item (Array N ix e)] #

(Index ix, NFData e, Eq e) => Eq (Array N ix e) Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

(==) :: Array N ix e -> Array N ix e -> Bool #

(/=) :: Array N ix e -> Array N ix e -> Bool #

(Index ix, NFData e, Ord e) => Ord (Array N ix e) Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

compare :: Array N ix e -> Array N ix e -> Ordering #

(<) :: Array N ix e -> Array N ix e -> Bool #

(<=) :: Array N ix e -> Array N ix e -> Bool #

(>) :: Array N ix e -> Array N ix e -> Bool #

(>=) :: Array N ix e -> Array N ix e -> Bool #

max :: Array N ix e -> Array N ix e -> Array N ix e #

min :: Array N ix e -> Array N ix e -> Array N ix e #

(Index ix, NFData e) => NFData (Array N ix e) Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

rnf :: Array N ix e -> () #

newtype Array N ix e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

newtype Array N ix e = NArray {}
type VRepr N Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Vector

type VRepr N = Vector
newtype MArray s N ix e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

newtype MArray s N ix e = MNArray {}
type EltRepr N ix Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

type EltRepr N ix = M
type Item (Array N ix e) Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

type Item (Array N ix e) = Item (Array L ix e)

data Uninitialized Source #

An error that gets thrown when an unitialized element of a boxed array gets accessed. Can only happen when array was constructed with unsafeNew.

Constructors

Uninitialized 

Conversion

Important part of all conversions in this section is that the actual boxed Array, which holds the pointers to values isn't copied around, it is always kept as the same array. Conversion to Massiv boxed array will undergo evaluation during which computation strategies will be respected.

unwrapArray :: Array B ix e -> Array e Source #

O(1) - Unwrap boxed array.

Since: 0.2.1

evalArray Source #

Arguments

:: Comp

Computation strategy

-> Array e

Lazy boxed array from primitive package.

-> Array B Ix1 e 

O(n) - Wrap a boxed array and evaluate all elements to a WHNF.

Since: 0.2.1

unwrapMutableArray :: MArray s B ix e -> MutableArray s e Source #

O(1) - Unwrap mutable boxed array.

Since: 0.2.1

evalMutableArray Source #

Arguments

:: PrimMonad m 
=> MutableArray (PrimState m) e

Mutable array that will get wrapped

-> m (MArray (PrimState m) B Ix1 e) 

O(n) - Wrap mutable boxed array and evaluate all elements to WHNF.

Since: 0.2.1

unwrapNormalFormArray :: Array N ix e -> Array e Source #

O(1) - Unwrap a fully evaluated boxed array.

Since: 0.2.1

evalNormalFormArray Source #

Arguments

:: NFData e 
=> Comp

Computation strategy

-> Array e

Lazy boxed array

-> Array N Ix1 e 

O(n) - Wrap a boxed array and evaluate all elements to a Normal Form (NF).

Since: 0.2.1

unwrapNormalFormMutableArray :: MArray s N ix e -> MutableArray s e Source #

O(1) - Unwrap a fully evaluated mutable boxed array.

Since: 0.2.1

evalNormalFormMutableArray :: (PrimMonad m, NFData e) => MutableArray (PrimState m) e -> m (MArray (PrimState m) N Ix1 e) Source #

O(n) - Wrap mutable boxed array and evaluate all elements to NF.

Since: 0.2.1

Primitive

data P Source #

Representation for Primitive elements

Constructors

P 
Instances
Show P Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Primitive

Methods

showsPrec :: Int -> P -> ShowS #

show :: P -> String #

showList :: [P] -> ShowS #

(Index ix, Prim e) => Mutable P ix e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Primitive

Associated Types

data MArray s P ix e :: Type Source #

Methods

msize :: MArray s P ix e -> Sz ix Source #

unsafeThaw :: PrimMonad m => Array P ix e -> m (MArray (PrimState m) P ix e) Source #

unsafeFreeze :: PrimMonad m => Comp -> MArray (PrimState m) P ix e -> m (Array P ix e) Source #

unsafeNew :: PrimMonad m => Sz ix -> m (MArray (PrimState m) P ix e) Source #

unsafeNewZero :: PrimMonad m => Sz ix -> m (MArray (PrimState m) P ix e) Source #

unsafeLinearRead :: PrimMonad m => MArray (PrimState m) P ix e -> Int -> m e Source #

unsafeLinearWrite :: PrimMonad m => MArray (PrimState m) P ix e -> Int -> e -> m () Source #

unsafeNewA :: Applicative f => ix -> WorldState -> f (WorldState, MArray RealWorld P ix e)

unsafeThawA :: Applicative m => Array P ix e -> WorldState -> m (WorldState, MArray RealWorld P ix e)

unsafeFreezeA :: Applicative m => Comp -> MArray RealWorld P ix e -> WorldState -> m (WorldState, Array P ix e)

unsafeLinearWriteA :: Applicative m => MArray RealWorld P ix e -> Int -> e -> WorldState -> m WorldState

(Index ix, Prim e) => Manifest P ix e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Primitive

Methods

unsafeLinearIndexM :: Array P ix e -> Int -> e Source #

(Prim e, Index ix, Index (Lower ix), Elt P ix e ~ Elt M ix e, Elt M ix e ~ Array M (Lower ix) e) => Slice P ix e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Primitive

Methods

unsafeSlice :: Array P ix e -> ix -> Sz ix -> Dim -> Maybe (Elt P ix e) Source #

Prim e => Slice P Ix1 e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Primitive

Methods

unsafeSlice :: Array P Ix1 e -> Ix1 -> Sz Ix1 -> Dim -> Maybe (Elt P Ix1 e) Source #

(Prim e, Index ix, Index (Lower ix), Elt M ix e ~ Array M (Lower ix) e, Elt P ix e ~ Array M (Lower ix) e) => InnerSlice P ix e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Primitive

Methods

unsafeInnerSlice :: Array P ix e -> (Sz (Lower ix), Sz1) -> Int -> Elt P ix e Source #

Prim e => InnerSlice P Ix1 e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Primitive

Methods

unsafeInnerSlice :: Array P Ix1 e -> (Sz (Lower Ix1), Sz1) -> Int -> Elt P Ix1 e Source #

(Prim e, Index ix, Index (Lower ix), Elt M ix e ~ Array M (Lower ix) e, Elt P ix e ~ Array M (Lower ix) e) => OuterSlice P ix e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Primitive

Methods

unsafeOuterSlice :: Array P ix e -> Int -> Elt P ix e Source #

outerLength :: Array P ix e -> Int Source #

Prim e => OuterSlice P Ix1 e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Primitive

(Prim e, Index ix) => Source P ix e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Primitive

Methods

unsafeIndex :: Array P ix e -> ix -> e Source #

unsafeLinearIndex :: Array P ix e -> Int -> e Source #

(Prim e, Index ix) => Size P ix e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Primitive

Methods

size :: Array P ix e -> Sz ix Source #

unsafeResize :: Index ix' => Sz ix' -> Array P ix e -> Array P ix' e Source #

unsafeExtract :: ix -> Sz ix -> Array P ix e -> Array (EltRepr P ix) ix e Source #

(Prim e, Index ix) => Construct P ix e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Primitive

Methods

getComp :: Array P ix e -> Comp Source #

setComp :: Comp -> Array P ix e -> Array P ix e Source #

unsafeMakeArray :: Comp -> Sz ix -> (ix -> e) -> Array P ix e Source #

(Prim e, IsList (Array L ix e), Nested LN ix e, Nested L ix e, Ragged L ix e) => IsList (Array P ix e) Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Primitive

Associated Types

type Item (Array P ix e) :: Type #

Methods

fromList :: [Item (Array P ix e)] -> Array P ix e #

fromListN :: Int -> [Item (Array P ix e)] -> Array P ix e #

toList :: Array P ix e -> [Item (Array P ix e)] #

(Prim e, Eq e, Index ix) => Eq (Array P ix e) Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Primitive

Methods

(==) :: Array P ix e -> Array P ix e -> Bool #

(/=) :: Array P ix e -> Array P ix e -> Bool #

(Prim e, Ord e, Index ix) => Ord (Array P ix e) Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Primitive

Methods

compare :: Array P ix e -> Array P ix e -> Ordering #

(<) :: Array P ix e -> Array P ix e -> Bool #

(<=) :: Array P ix e -> Array P ix e -> Bool #

(>) :: Array P ix e -> Array P ix e -> Bool #

(>=) :: Array P ix e -> Array P ix e -> Bool #

max :: Array P ix e -> Array P ix e -> Array P ix e #

min :: Array P ix e -> Array P ix e -> Array P ix e #

Index ix => NFData (Array P ix e) Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Primitive

Methods

rnf :: Array P ix e -> () #

data Array P ix e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Primitive

data Array P ix e = PArray {}
type VRepr P Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Vector

type VRepr P = Vector
data MArray s P ix e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Primitive

data MArray s P ix e = MPArray !ix !(MutableByteArray s)
type EltRepr P ix Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Primitive

type EltRepr P ix = M
type Item (Array P ix e) Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Primitive

type Item (Array P ix e) = Item (Array L ix e)

class Prim a #

Class of types supporting primitive array operations

Instances
Prim Char 
Instance details

Defined in Data.Primitive.Types

Prim Double 
Instance details

Defined in Data.Primitive.Types

Prim Float 
Instance details

Defined in Data.Primitive.Types

Prim Int 
Instance details

Defined in Data.Primitive.Types

Prim Int8 
Instance details

Defined in Data.Primitive.Types

Prim Int16 
Instance details

Defined in Data.Primitive.Types

Prim Int32 
Instance details

Defined in Data.Primitive.Types

Prim Int64 
Instance details

Defined in Data.Primitive.Types

Prim Word 
Instance details

Defined in Data.Primitive.Types

Prim Word8 
Instance details

Defined in Data.Primitive.Types

Prim Word16 
Instance details

Defined in Data.Primitive.Types

Prim Word32 
Instance details

Defined in Data.Primitive.Types

Prim Word64 
Instance details

Defined in Data.Primitive.Types

Prim CDev 
Instance details

Defined in Data.Primitive.Types

Prim CIno 
Instance details

Defined in Data.Primitive.Types

Prim CMode 
Instance details

Defined in Data.Primitive.Types

Prim COff 
Instance details

Defined in Data.Primitive.Types

Prim CPid 
Instance details

Defined in Data.Primitive.Types

Prim CSsize 
Instance details

Defined in Data.Primitive.Types

Prim CGid 
Instance details

Defined in Data.Primitive.Types

Prim CNlink 
Instance details

Defined in Data.Primitive.Types

Prim CUid 
Instance details

Defined in Data.Primitive.Types

Prim CCc 
Instance details

Defined in Data.Primitive.Types

Prim CSpeed 
Instance details

Defined in Data.Primitive.Types

Prim CTcflag 
Instance details

Defined in Data.Primitive.Types

Prim CRLim 
Instance details

Defined in Data.Primitive.Types

Prim CBlkSize 
Instance details

Defined in Data.Primitive.Types

Prim CBlkCnt 
Instance details

Defined in Data.Primitive.Types

Prim CClockId 
Instance details

Defined in Data.Primitive.Types

Prim CFsBlkCnt 
Instance details

Defined in Data.Primitive.Types

Prim CFsFilCnt 
Instance details

Defined in Data.Primitive.Types

Prim CId 
Instance details

Defined in Data.Primitive.Types

Prim CKey 
Instance details

Defined in Data.Primitive.Types

Prim CTimer 
Instance details

Defined in Data.Primitive.Types

Prim Fd 
Instance details

Defined in Data.Primitive.Types

Prim CChar 
Instance details

Defined in Data.Primitive.Types

Prim CSChar 
Instance details

Defined in Data.Primitive.Types

Prim CUChar 
Instance details

Defined in Data.Primitive.Types

Prim CShort 
Instance details

Defined in Data.Primitive.Types

Prim CUShort 
Instance details

Defined in Data.Primitive.Types

Prim CInt 
Instance details

Defined in Data.Primitive.Types

Prim CUInt 
Instance details

Defined in Data.Primitive.Types

Prim CLong 
Instance details

Defined in Data.Primitive.Types

Prim CULong 
Instance details

Defined in Data.Primitive.Types

Prim CLLong 
Instance details

Defined in Data.Primitive.Types

Prim CULLong 
Instance details

Defined in Data.Primitive.Types

Prim CBool 
Instance details

Defined in Data.Primitive.Types

Prim CFloat 
Instance details

Defined in Data.Primitive.Types

Prim CDouble 
Instance details

Defined in Data.Primitive.Types

Prim CPtrdiff 
Instance details

Defined in Data.Primitive.Types

Prim CSize 
Instance details

Defined in Data.Primitive.Types

Prim CWchar 
Instance details

Defined in Data.Primitive.Types

Prim CSigAtomic 
Instance details

Defined in Data.Primitive.Types

Prim CClock 
Instance details

Defined in Data.Primitive.Types

Prim CTime 
Instance details

Defined in Data.Primitive.Types

Prim CUSeconds 
Instance details

Defined in Data.Primitive.Types

Prim CSUSeconds 
Instance details

Defined in Data.Primitive.Types

Prim CIntPtr 
Instance details

Defined in Data.Primitive.Types

Prim CUIntPtr 
Instance details

Defined in Data.Primitive.Types

Prim CIntMax 
Instance details

Defined in Data.Primitive.Types

Prim CUIntMax 
Instance details

Defined in Data.Primitive.Types

Prim Addr 
Instance details

Defined in Data.Primitive.Types

Prim (Ptr a) 
Instance details

Defined in Data.Primitive.Types

Prim (FunPtr a) 
Instance details

Defined in Data.Primitive.Types

Conversion

toByteArray :: Array P ix e -> ByteArray Source #

O(1) - Extract the internal ByteArray.

Since: 0.2.1

fromByteArray :: (Index ix, Prim e) => Comp -> ix -> ByteArray -> Maybe (Array P ix e) Source #

O(1) - Construct a primitive array from the ByteArray. Will return Nothing if number of elements doesn't match.

Since: 0.2.1

toMutableByteArray :: MArray s P ix e -> MutableByteArray s Source #

O(1) - Extract the internal MutableByteArray.

Since: 0.2.1

fromMutableByteArray :: (Index ix, Prim e) => ix -> MutableByteArray s -> Maybe (MArray s P ix e) Source #

O(1) - Construct a primitive mutable array from the MutableByteArray. Will return Nothing if number of elements doesn't match.

Since: 0.2.1

Storable

data S Source #

Representation for Storable elements

Constructors

S 
Instances
Show S Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Storable

Methods

showsPrec :: Int -> S -> ShowS #

show :: S -> String #

showList :: [S] -> ShowS #

(Index ix, Storable e) => Mutable S ix e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Storable

Associated Types

data MArray s S ix e :: Type Source #

Methods

msize :: MArray s S ix e -> Sz ix Source #

unsafeThaw :: PrimMonad m => Array S ix e -> m (MArray (PrimState m) S ix e) Source #

unsafeFreeze :: PrimMonad m => Comp -> MArray (PrimState m) S ix e -> m (Array S ix e) Source #

unsafeNew :: PrimMonad m => Sz ix -> m (MArray (PrimState m) S ix e) Source #

unsafeNewZero :: PrimMonad m => Sz ix -> m (MArray (PrimState m) S ix e) Source #

unsafeLinearRead :: PrimMonad m => MArray (PrimState m) S ix e -> Int -> m e Source #

unsafeLinearWrite :: PrimMonad m => MArray (PrimState m) S ix e -> Int -> e -> m () Source #

unsafeNewA :: Applicative f => ix -> WorldState -> f (WorldState, MArray RealWorld S ix e)

unsafeThawA :: Applicative m => Array S ix e -> WorldState -> m (WorldState, MArray RealWorld S ix e)

unsafeFreezeA :: Applicative m => Comp -> MArray RealWorld S ix e -> WorldState -> m (WorldState, Array S ix e)

unsafeLinearWriteA :: Applicative m => MArray RealWorld S ix e -> Int -> e -> WorldState -> m WorldState

(Index ix, Storable e) => Manifest S ix e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Storable

Methods

unsafeLinearIndexM :: Array S ix e -> Int -> 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 # 
Instance details

Defined in Data.Massiv.Array.Manifest.Storable

Methods

unsafeInnerSlice :: Array S ix e -> (Sz (Lower ix), Sz1) -> Int -> Elt 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 # 
Instance details

Defined in Data.Massiv.Array.Manifest.Storable

Methods

unsafeOuterSlice :: Array S ix e -> Int -> Elt S ix e Source #

outerLength :: Array S ix e -> Int Source #

(Storable e, Index ix) => Source S ix e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Storable

Methods

unsafeIndex :: Array S ix e -> ix -> e Source #

unsafeLinearIndex :: Array S ix e -> Int -> e Source #

(Storable e, Index ix) => Size S ix e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Storable

Methods

size :: Array S ix e -> Sz ix Source #

unsafeResize :: Index ix' => Sz ix' -> Array S ix e -> Array S ix' e Source #

unsafeExtract :: ix -> Sz ix -> Array S ix e -> Array (EltRepr S ix) ix e Source #

(Storable e, Index ix) => Construct S ix e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Storable

Methods

getComp :: Array S ix e -> Comp Source #

setComp :: Comp -> Array S ix e -> Array S ix e Source #

unsafeMakeArray :: Comp -> Sz ix -> (ix -> e) -> Array 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 # 
Instance details

Defined in Data.Massiv.Array.Manifest.Storable

Associated Types

type Item (Array S ix e) :: Type #

Methods

fromList :: [Item (Array S ix e)] -> Array S ix e #

fromListN :: Int -> [Item (Array S ix e)] -> Array S ix e #

toList :: Array S ix e -> [Item (Array S ix e)] #

(Storable e, Eq e, Index ix) => Eq (Array S ix e) Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Storable

Methods

(==) :: Array S ix e -> Array S ix e -> Bool #

(/=) :: Array S ix e -> Array S ix e -> Bool #

(Storable e, Ord e, Index ix) => Ord (Array S ix e) Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Storable

Methods

compare :: Array S ix e -> Array S ix e -> Ordering #

(<) :: Array S ix e -> Array S ix e -> Bool #

(<=) :: Array S ix e -> Array S ix e -> Bool #

(>) :: Array S ix e -> Array S ix e -> Bool #

(>=) :: Array S ix e -> Array S ix e -> Bool #

max :: Array S ix e -> Array S ix e -> Array S ix e #

min :: Array S ix e -> Array S ix e -> Array S ix e #

Index ix => NFData (Array S ix e) Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Storable

Methods

rnf :: Array S ix e -> () #

data Array S ix e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Storable

data Array S ix e = SArray {}
type VRepr S Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Vector

type VRepr S = Vector
data MArray s S ix e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Storable

data MArray s S ix e = MSArray !ix !(MVector s e)
type EltRepr S ix Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Storable

type EltRepr S ix = M
type Item (Array S ix e) Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Storable

type Item (Array S ix e) = Item (Array L ix e)

class Storable a #

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 Ptr a, for some a 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.

Minimal complete definition

sizeOf, alignment, (peek | peekElemOff | peekByteOff), (poke | pokeElemOff | pokeByteOff)

Instances
Storable Bool

Since: base-2.1

Instance details

Defined in Foreign.Storable

Methods

sizeOf :: Bool -> Int #

alignment :: Bool -> Int #

peekElemOff :: Ptr Bool -> Int -> IO Bool #

pokeElemOff :: Ptr Bool -> Int -> Bool -> IO () #

peekByteOff :: Ptr b -> Int -> IO Bool #

pokeByteOff :: Ptr b -> Int -> Bool -> IO () #

peek :: Ptr Bool -> IO Bool #

poke :: Ptr Bool -> Bool -> IO () #

Storable Char

Since: base-2.1

Instance details

Defined in Foreign.Storable

Methods

sizeOf :: Char -> Int #

alignment :: Char -> Int #

peekElemOff :: Ptr Char -> Int -> IO Char #

pokeElemOff :: Ptr Char -> Int -> Char -> IO () #

peekByteOff :: Ptr b -> Int -> IO Char #

pokeByteOff :: Ptr b -> Int -> Char -> IO () #

peek :: Ptr Char -> IO Char #

poke :: Ptr Char -> Char -> IO () #

Storable Double

Since: base-2.1

Instance details

Defined in Foreign.Storable

Storable Float

Since: base-2.1

Instance details

Defined in Foreign.Storable

Methods

sizeOf :: Float -> Int #

alignment :: Float -> Int #

peekElemOff :: Ptr Float -> Int -> IO Float #

pokeElemOff :: Ptr Float -> Int -> Float -> IO () #

peekByteOff :: Ptr b -> Int -> IO Float #

pokeByteOff :: Ptr b -> Int -> Float -> IO () #

peek :: Ptr Float -> IO Float #

poke :: Ptr Float -> Float -> IO () #

Storable Int

Since: base-2.1

Instance details

Defined in Foreign.Storable

Methods

sizeOf :: Int -> Int #

alignment :: Int -> Int #

peekElemOff :: Ptr Int -> Int -> IO Int #

pokeElemOff :: Ptr Int -> Int -> Int -> IO () #

peekByteOff :: Ptr b -> Int -> IO Int #

pokeByteOff :: Ptr b -> Int -> Int -> IO () #

peek :: Ptr Int -> IO Int #

poke :: Ptr Int -> Int -> IO () #

Storable Int8

Since: base-2.1

Instance details

Defined in Foreign.Storable

Methods

sizeOf :: Int8 -> Int #

alignment :: Int8 -> Int #

peekElemOff :: Ptr Int8 -> Int -> IO Int8 #

pokeElemOff :: Ptr Int8 -> Int -> Int8 -> IO () #

peekByteOff :: Ptr b -> Int -> IO Int8 #

pokeByteOff :: Ptr b -> Int -> Int8 -> IO () #

peek :: Ptr Int8 -> IO Int8 #

poke :: Ptr Int8 -> Int8 -> IO () #

Storable Int16

Since: base-2.1

Instance details

Defined in Foreign.Storable

Methods

sizeOf :: Int16 -> Int #

alignment :: Int16 -> Int #

peekElemOff :: Ptr Int16 -> Int -> IO Int16 #

pokeElemOff :: Ptr Int16 -> Int -> Int16 -> IO () #

peekByteOff :: Ptr b -> Int -> IO Int16 #

pokeByteOff :: Ptr b -> Int -> Int16 -> IO () #

peek :: Ptr Int16 -> IO Int16 #

poke :: Ptr Int16 -> Int16 -> IO () #

Storable Int32

Since: base-2.1

Instance details

Defined in Foreign.Storable

Methods

sizeOf :: Int32 -> Int #

alignment :: Int32 -> Int #

peekElemOff :: Ptr Int32 -> Int -> IO Int32 #

pokeElemOff :: Ptr Int32 -> Int -> Int32 -> IO () #

peekByteOff :: Ptr b -> Int -> IO Int32 #

pokeByteOff :: Ptr b -> Int -> Int32 -> IO () #

peek :: Ptr Int32 -> IO Int32 #

poke :: Ptr Int32 -> Int32 -> IO () #

Storable Int64

Since: base-2.1

Instance details

Defined in Foreign.Storable

Methods

sizeOf :: Int64 -> Int #

alignment :: Int64 -> Int #

peekElemOff :: Ptr Int64 -> Int -> IO Int64 #

pokeElemOff :: Ptr Int64 -> Int -> Int64 -> IO () #

peekByteOff :: Ptr b -> Int -> IO Int64 #

pokeByteOff :: Ptr b -> Int -> Int64 -> IO () #

peek :: Ptr Int64 -> IO Int64 #

poke :: Ptr Int64 -> Int64 -> IO () #

Storable Word

Since: base-2.1

Instance details

Defined in Foreign.Storable

Methods

sizeOf :: Word -> Int #

alignment :: Word -> Int #

peekElemOff :: Ptr Word -> Int -> IO Word #

pokeElemOff :: Ptr Word -> Int -> Word -> IO () #

peekByteOff :: Ptr b -> Int -> IO Word #

pokeByteOff :: Ptr b -> Int -> Word -> IO () #

peek :: Ptr Word -> IO Word #

poke :: Ptr Word -> Word -> IO () #

Storable Word8

Since: base-2.1

Instance details

Defined in Foreign.Storable

Methods

sizeOf :: Word8 -> Int #

alignment :: Word8 -> Int #

peekElemOff :: Ptr Word8 -> Int -> IO Word8 #

pokeElemOff :: Ptr Word8 -> Int -> Word8 -> IO () #

peekByteOff :: Ptr b -> Int -> IO Word8 #

pokeByteOff :: Ptr b -> Int -> Word8 -> IO () #

peek :: Ptr Word8 -> IO Word8 #

poke :: Ptr Word8 -> Word8 -> IO () #

Storable Word16

Since: base-2.1

Instance details

Defined in Foreign.Storable

Storable Word32

Since: base-2.1

Instance details

Defined in Foreign.Storable

Storable Word64

Since: base-2.1

Instance details

Defined in Foreign.Storable

Storable ()

Since: base-4.9.0.0

Instance details

Defined in Foreign.Storable

Methods

sizeOf :: () -> Int #

alignment :: () -> Int #

peekElemOff :: Ptr () -> Int -> IO () #

pokeElemOff :: Ptr () -> Int -> () -> IO () #

peekByteOff :: Ptr b -> Int -> IO () #

pokeByteOff :: Ptr b -> Int -> () -> IO () #

peek :: Ptr () -> IO () #

poke :: Ptr () -> () -> IO () #

Storable CChar 
Instance details

Defined in Foreign.C.Types

Methods

sizeOf :: CChar -> Int #

alignment :: CChar -> Int #

peekElemOff :: Ptr CChar -> Int -> IO CChar #

pokeElemOff :: Ptr CChar -> Int -> CChar -> IO () #

peekByteOff :: Ptr b -> Int -> IO CChar #

pokeByteOff :: Ptr b -> Int -> CChar -> IO () #

peek :: Ptr CChar -> IO CChar #

poke :: Ptr CChar -> CChar -> IO () #

Storable CSChar 
Instance details

Defined in Foreign.C.Types

Storable CUChar 
Instance details

Defined in Foreign.C.Types

Storable CShort 
Instance details

Defined in Foreign.C.Types

Storable CUShort 
Instance details

Defined in Foreign.C.Types

Storable CInt 
Instance details

Defined in Foreign.C.Types

Methods

sizeOf :: CInt -> Int #

alignment :: CInt -> Int #

peekElemOff :: Ptr CInt -> Int -> IO CInt #

pokeElemOff :: Ptr CInt -> Int -> CInt -> IO () #

peekByteOff :: Ptr b -> Int -> IO CInt #

pokeByteOff :: Ptr b -> Int -> CInt -> IO () #

peek :: Ptr CInt -> IO CInt #

poke :: Ptr CInt -> CInt -> IO () #

Storable CUInt 
Instance details

Defined in Foreign.C.Types

Methods

sizeOf :: CUInt -> Int #

alignment :: CUInt -> Int #

peekElemOff :: Ptr CUInt -> Int -> IO CUInt #

pokeElemOff :: Ptr CUInt -> Int -> CUInt -> IO () #

peekByteOff :: Ptr b -> Int -> IO CUInt #

pokeByteOff :: Ptr b -> Int -> CUInt -> IO () #

peek :: Ptr CUInt -> IO CUInt #

poke :: Ptr CUInt -> CUInt -> IO () #

Storable CLong 
Instance details

Defined in Foreign.C.Types

Methods

sizeOf :: CLong -> Int #

alignment :: CLong -> Int #

peekElemOff :: Ptr CLong -> Int -> IO CLong #

pokeElemOff :: Ptr CLong -> Int -> CLong -> IO () #

peekByteOff :: Ptr b -> Int -> IO CLong #

pokeByteOff :: Ptr b -> Int -> CLong -> IO () #

peek :: Ptr CLong -> IO CLong #

poke :: Ptr CLong -> CLong -> IO () #

Storable CULong 
Instance details

Defined in Foreign.C.Types

Storable CLLong 
Instance details

Defined in Foreign.C.Types

Storable CULLong 
Instance details

Defined in Foreign.C.Types

Storable CBool 
Instance details

Defined in Foreign.C.Types

Methods

sizeOf :: CBool -> Int #

alignment :: CBool -> Int #

peekElemOff :: Ptr CBool -> Int -> IO CBool #

pokeElemOff :: Ptr CBool -> Int -> CBool -> IO () #

peekByteOff :: Ptr b -> Int -> IO CBool #

pokeByteOff :: Ptr b -> Int -> CBool -> IO () #

peek :: Ptr CBool -> IO CBool #

poke :: Ptr CBool -> CBool -> IO () #

Storable CFloat 
Instance details

Defined in Foreign.C.Types

Storable CDouble 
Instance details

Defined in Foreign.C.Types

Storable CPtrdiff 
Instance details

Defined in Foreign.C.Types

Storable CSize 
Instance details

Defined in Foreign.C.Types

Methods

sizeOf :: CSize -> Int #

alignment :: CSize -> Int #

peekElemOff :: Ptr CSize -> Int -> IO CSize #

pokeElemOff :: Ptr CSize -> Int -> CSize -> IO () #

peekByteOff :: Ptr b -> Int -> IO CSize #

pokeByteOff :: Ptr b -> Int -> CSize -> IO () #

peek :: Ptr CSize -> IO CSize #

poke :: Ptr CSize -> CSize -> IO () #

Storable CWchar 
Instance details

Defined in Foreign.C.Types

Storable CSigAtomic 
Instance details

Defined in Foreign.C.Types

Storable CClock 
Instance details

Defined in Foreign.C.Types

Storable CTime 
Instance details

Defined in Foreign.C.Types

Methods

sizeOf :: CTime -> Int #

alignment :: CTime -> Int #

peekElemOff :: Ptr CTime -> Int -> IO CTime #

pokeElemOff :: Ptr CTime -> Int -> CTime -> IO () #

peekByteOff :: Ptr b -> Int -> IO CTime #

pokeByteOff :: Ptr b -> Int -> CTime -> IO () #

peek :: Ptr CTime -> IO CTime #

poke :: Ptr CTime -> CTime -> IO () #

Storable CUSeconds 
Instance details

Defined in Foreign.C.Types

Storable CSUSeconds 
Instance details

Defined in Foreign.C.Types

Storable CIntPtr 
Instance details

Defined in Foreign.C.Types

Storable CUIntPtr 
Instance details

Defined in Foreign.C.Types

Storable CIntMax 
Instance details

Defined in Foreign.C.Types

Storable CUIntMax 
Instance details

Defined in Foreign.C.Types

Storable WordPtr 
Instance details

Defined in Foreign.Ptr

Storable IntPtr 
Instance details

Defined in Foreign.Ptr

Storable Fingerprint

Since: base-4.4.0.0

Instance details

Defined in Foreign.Storable

(Storable a, Integral a) => Storable (Ratio a)

Since: base-4.8.0.0

Instance details

Defined in Foreign.Storable

Methods

sizeOf :: Ratio a -> Int #

alignment :: Ratio a -> Int #

peekElemOff :: Ptr (Ratio a) -> Int -> IO (Ratio a) #

pokeElemOff :: Ptr (Ratio a) -> Int -> Ratio a -> IO () #

peekByteOff :: Ptr b -> Int -> IO (Ratio a) #

pokeByteOff :: Ptr b -> Int -> Ratio a -> IO () #

peek :: Ptr (Ratio a) -> IO (Ratio a) #

poke :: Ptr (Ratio a) -> Ratio a -> IO () #

Storable (StablePtr a)

Since: base-2.1

Instance details

Defined in Foreign.Storable

Methods

sizeOf :: StablePtr a -> Int #

alignment :: StablePtr a -> Int #

peekElemOff :: Ptr (StablePtr a) -> Int -> IO (StablePtr a) #

pokeElemOff :: Ptr (StablePtr a) -> Int -> StablePtr a -> IO () #

peekByteOff :: Ptr b -> Int -> IO (StablePtr a) #

pokeByteOff :: Ptr b -> Int -> StablePtr a -> IO () #

peek :: Ptr (StablePtr a) -> IO (StablePtr a) #

poke :: Ptr (StablePtr a) -> StablePtr a -> IO () #

Storable (Ptr a)

Since: base-2.1

Instance details

Defined in Foreign.Storable

Methods

sizeOf :: Ptr a -> Int #

alignment :: Ptr a -> Int #

peekElemOff :: Ptr (Ptr a) -> Int -> IO (Ptr a) #

pokeElemOff :: Ptr (Ptr a) -> Int -> Ptr a -> IO () #

peekByteOff :: Ptr b -> Int -> IO (Ptr a) #

pokeByteOff :: Ptr b -> Int -> Ptr a -> IO () #

peek :: Ptr (Ptr a) -> IO (Ptr a) #

poke :: Ptr (Ptr a) -> Ptr a -> IO () #

Storable (FunPtr a)

Since: base-2.1

Instance details

Defined in Foreign.Storable

Methods

sizeOf :: FunPtr a -> Int #

alignment :: FunPtr a -> Int #

peekElemOff :: Ptr (FunPtr a) -> Int -> IO (FunPtr a) #

pokeElemOff :: Ptr (FunPtr a) -> Int -> FunPtr a -> IO () #

peekByteOff :: Ptr b -> Int -> IO (FunPtr a) #

pokeByteOff :: Ptr b -> Int -> FunPtr a -> IO () #

peek :: Ptr (FunPtr a) -> IO (FunPtr a) #

poke :: Ptr (FunPtr a) -> FunPtr a -> IO () #

Storable a => Storable (Complex a)

Since: base-4.8.0.0

Instance details

Defined in Data.Complex

Methods

sizeOf :: Complex a -> Int #

alignment :: Complex a -> Int #

peekElemOff :: Ptr (Complex a) -> Int -> IO (Complex a) #

pokeElemOff :: Ptr (Complex a) -> Int -> Complex a -> IO () #

peekByteOff :: Ptr b -> Int -> IO (Complex a) #

pokeByteOff :: Ptr b -> Int -> Complex a -> IO () #

peek :: Ptr (Complex a) -> IO (Complex a) #

poke :: Ptr (Complex a) -> Complex a -> IO () #

Storable a => Storable (Identity a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Identity

Methods

sizeOf :: Identity a -> Int #

alignment :: Identity a -> Int #

peekElemOff :: Ptr (Identity a) -> Int -> IO (Identity a) #

pokeElemOff :: Ptr (Identity a) -> Int -> Identity a -> IO () #

peekByteOff :: Ptr b -> Int -> IO (Identity a) #

pokeByteOff :: Ptr b -> Int -> Identity a -> IO () #

peek :: Ptr (Identity a) -> IO (Identity a) #

poke :: Ptr (Identity a) -> Identity a -> IO () #

Prim a => Storable (PrimStorable a) 
Instance details

Defined in Data.Primitive.Types

Storable a => Storable (Const a b)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Const

Methods

sizeOf :: Const a b -> Int #

alignment :: Const a b -> Int #

peekElemOff :: Ptr (Const a b) -> Int -> IO (Const a b) #

pokeElemOff :: Ptr (Const a b) -> Int -> Const a b -> IO () #

peekByteOff :: Ptr b0 -> Int -> IO (Const a b) #

pokeByteOff :: Ptr b0 -> Int -> Const a b -> IO () #

peek :: Ptr (Const a b) -> IO (Const a b) #

poke :: Ptr (Const a b) -> Const a b -> IO () #

Conversion

toStorableVector :: Array S ix e -> Vector e Source #

O(1) - Unwrap storable array and pull out the underlying storable vector.

Since: 0.2.1

toStorableMVector :: MArray s S ix e -> MVector s e Source #

O(1) - Unwrap storable mutable array and pull out the underlying storable mutable vector.

Since: 0.2.1

Direct Pointer Access

withPtr :: (Index ix, Storable a) => MArray RealWorld S ix a -> (Ptr a -> IO b) -> IO b Source #

A pointer to the beginning of the mutable array.

Since: 0.1.3

unsafeWithPtr :: Storable a => Array S ix a -> (Ptr a -> IO b) -> IO b Source #

A pointer to the beginning of the storable array. It is unsafe since it can break referential transparency.

Since: 0.1.3

Unboxed

data U Source #

Representation for Unboxed elements

Constructors

U 
Instances
Show U Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Unboxed

Methods

showsPrec :: Int -> U -> ShowS #

show :: U -> String #

showList :: [U] -> ShowS #

(Unbox e, Index ix) => Mutable U ix e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Unboxed

Associated Types

data MArray s U ix e :: Type Source #

Methods

msize :: MArray s U ix e -> Sz ix Source #

unsafeThaw :: PrimMonad m => Array U ix e -> m (MArray (PrimState m) U ix e) Source #

unsafeFreeze :: PrimMonad m => Comp -> MArray (PrimState m) U ix e -> m (Array U ix e) Source #

unsafeNew :: PrimMonad m => Sz ix -> m (MArray (PrimState m) U ix e) Source #

unsafeNewZero :: PrimMonad m => Sz ix -> m (MArray (PrimState m) U ix e) Source #

unsafeLinearRead :: PrimMonad m => MArray (PrimState m) U ix e -> Int -> m e Source #

unsafeLinearWrite :: PrimMonad m => MArray (PrimState m) U ix e -> Int -> e -> m () Source #

unsafeNewA :: Applicative f => ix -> WorldState -> f (WorldState, MArray RealWorld U ix e)

unsafeThawA :: Applicative m => Array U ix e -> WorldState -> m (WorldState, MArray RealWorld U ix e)

unsafeFreezeA :: Applicative m => Comp -> MArray RealWorld U ix e -> WorldState -> m (WorldState, Array U ix e)

unsafeLinearWriteA :: Applicative m => MArray RealWorld U ix e -> Int -> e -> WorldState -> m WorldState

(Unbox e, Index ix) => Manifest U ix e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Unboxed

Methods

unsafeLinearIndexM :: Array U ix e -> Int -> e Source #

(Unbox e, Index ix, Index (Lower ix), Elt U ix e ~ Elt M ix e, Elt M ix e ~ Array M (Lower ix) e) => Slice U ix e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Unboxed

Methods

unsafeSlice :: Array U ix e -> ix -> Sz ix -> Dim -> Maybe (Elt U ix e) Source #

Unbox e => Slice U Ix1 e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Unboxed

Methods

unsafeSlice :: Array U Ix1 e -> Ix1 -> Sz Ix1 -> Dim -> Maybe (Elt U Ix1 e) Source #

(Unbox e, Index ix, Index (Lower ix), Elt U ix e ~ Elt M ix e, Elt M ix e ~ Array M (Lower ix) e) => InnerSlice U ix e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Unboxed

Methods

unsafeInnerSlice :: Array U ix e -> (Sz (Lower ix), Sz1) -> Int -> Elt U ix e Source #

Unbox e => InnerSlice U Ix1 e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Unboxed

Methods

unsafeInnerSlice :: Array U Ix1 e -> (Sz (Lower Ix1), Sz1) -> Int -> Elt U Ix1 e Source #

(Unbox e, Index ix, Index (Lower ix), Elt U ix e ~ Elt M ix e, Elt M ix e ~ Array M (Lower ix) e) => OuterSlice U ix e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Unboxed

Methods

unsafeOuterSlice :: Array U ix e -> Int -> Elt U ix e Source #

outerLength :: Array U ix e -> Int Source #

Unbox e => OuterSlice U Ix1 e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Unboxed

(Unbox e, Index ix) => Source U ix e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Unboxed

Methods

unsafeIndex :: Array U ix e -> ix -> e Source #

unsafeLinearIndex :: Array U ix e -> Int -> e Source #

(Unbox e, Index ix) => Size U ix e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Unboxed

Methods

size :: Array U ix e -> Sz ix Source #

unsafeResize :: Index ix' => Sz ix' -> Array U ix e -> Array U ix' e Source #

unsafeExtract :: ix -> Sz ix -> Array U ix e -> Array (EltRepr U ix) ix e Source #

(Unbox e, Index ix) => Construct U ix e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Unboxed

Methods

getComp :: Array U ix e -> Comp Source #

setComp :: Comp -> Array U ix e -> Array U ix e Source #

unsafeMakeArray :: Comp -> Sz ix -> (ix -> e) -> Array U ix e Source #

(Unbox e, IsList (Array L ix e), Nested LN ix e, Nested L ix e, Ragged L ix e) => IsList (Array U ix e) Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Unboxed

Associated Types

type Item (Array U ix e) :: Type #

Methods

fromList :: [Item (Array U ix e)] -> Array U ix e #

fromListN :: Int -> [Item (Array U ix e)] -> Array U ix e #

toList :: Array U ix e -> [Item (Array U ix e)] #

(Unbox e, Eq e, Index ix) => Eq (Array U ix e) Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Unboxed

Methods

(==) :: Array U ix e -> Array U ix e -> Bool #

(/=) :: Array U ix e -> Array U ix e -> Bool #

(Unbox e, Ord e, Index ix) => Ord (Array U ix e) Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Unboxed

Methods

compare :: Array U ix e -> Array U ix e -> Ordering #

(<) :: Array U ix e -> Array U ix e -> Bool #

(<=) :: Array U ix e -> Array U ix e -> Bool #

(>) :: Array U ix e -> Array U ix e -> Bool #

(>=) :: Array U ix e -> Array U ix e -> Bool #

max :: Array U ix e -> Array U ix e -> Array U ix e #

min :: Array U ix e -> Array U ix e -> Array U ix e #

(Index ix, NFData e) => NFData (Array U ix e) Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Unboxed

Methods

rnf :: Array U ix e -> () #

data Array U ix e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Unboxed

data Array U ix e = UArray {}
type VRepr U Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Vector

type VRepr U = Vector
data MArray s U ix e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Unboxed

data MArray s U ix e = MUArray ix (MVector s e)
type EltRepr U ix Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Unboxed

type EltRepr U ix = M
type Item (Array U ix e) Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Unboxed

type Item (Array U ix e) = Item (Array L ix e)

class (Vector Vector a, MVector MVector a) => Unbox a #

Instances
Unbox Bool 
Instance details

Defined in Data.Vector.Unboxed.Base

Unbox Char 
Instance details

Defined in Data.Vector.Unboxed.Base

Unbox Double 
Instance details

Defined in Data.Vector.Unboxed.Base

Unbox Float 
Instance details

Defined in Data.Vector.Unboxed.Base

Unbox Int 
Instance details

Defined in Data.Vector.Unboxed.Base

Unbox Int8 
Instance details

Defined in Data.Vector.Unboxed.Base

Unbox Int16 
Instance details

Defined in Data.Vector.Unboxed.Base

Unbox Int32 
Instance details

Defined in Data.Vector.Unboxed.Base

Unbox Int64 
Instance details

Defined in Data.Vector.Unboxed.Base

Unbox Word 
Instance details

Defined in Data.Vector.Unboxed.Base

Unbox Word8 
Instance details

Defined in Data.Vector.Unboxed.Base

Unbox Word16 
Instance details

Defined in Data.Vector.Unboxed.Base

Unbox Word32 
Instance details

Defined in Data.Vector.Unboxed.Base

Unbox Word64 
Instance details

Defined in Data.Vector.Unboxed.Base

Unbox () 
Instance details

Defined in Data.Vector.Unboxed.Base

Unbox Ix2 Source #

Unboxing of a Ix2.

Instance details

Defined in Data.Massiv.Core.Index.Ix

Unbox a => Unbox (Complex a) 
Instance details

Defined in Data.Vector.Unboxed.Base

(3 <= n, Unbox (Ix (n - 1))) => Unbox (IxN n) Source #

Unboxing of a IxN.

Instance details

Defined in Data.Massiv.Core.Index.Ix

(Unbox a, Unbox b) => Unbox (a, b) 
Instance details

Defined in Data.Vector.Unboxed.Base

(Unbox a, Unbox b, Unbox c) => Unbox (a, b, c) 
Instance details

Defined in Data.Vector.Unboxed.Base

(Unbox a, Unbox b, Unbox c, Unbox d) => Unbox (a, b, c, d) 
Instance details

Defined in Data.Vector.Unboxed.Base

(Unbox a, Unbox b, Unbox c, Unbox d, Unbox e) => Unbox (a, b, c, d, e) 
Instance details

Defined in Data.Vector.Unboxed.Base

(Unbox a, Unbox b, Unbox c, Unbox d, Unbox e, Unbox f) => Unbox (a, b, c, d, e, f) 
Instance details

Defined in Data.Vector.Unboxed.Base

Conversion

toUnboxedVector :: Array U ix e -> Vector e Source #

O(1) - Unwrap unboxed array and pull out the underlying unboxed vector.

Since: 0.2.1

toUnboxedMVector :: MArray s U ix e -> MVector s e Source #

O(1) - Unwrap unboxed mutable array and pull out the underlying unboxed mutable vector.

Since: 0.2.1

ByteString Conversion

fromByteString Source #

Arguments

:: Comp

Computation strategy

-> ByteString

Strict ByteString to use as a source.

-> Array M Ix1 Word8 

O(1) - Convert a strict ByteString into a manifest array. Will return Nothing if length doesn't match the total number of elements of new array.

Since: 0.2.1

toByteString Source #

Arguments

:: Source r ix Word8 
=> Array r ix Word8

Source array

-> ByteString 

O(n) - For now only sequentially convert an array into a strict ByteString

Since: 0.2.1

toBuilder :: Source r ix e => (e -> Builder) -> Array r ix e -> Builder Source #

O(n) - Conversion of array monoidally into a string Builder.

Since: 0.2.1