massiv-0.1.0.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 # 

Methods

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

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

Methods

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

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

Methods

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

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

Methods

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

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

Methods

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

Index ix => Manifest B ix e Source # 

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 # 

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 # 

Methods

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

Slice M Ix1 e Source # 

Methods

unsafeSlice :: Array M Ix1 e -> Ix1 -> 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 # 

Methods

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

InnerSlice M Ix1 e Source # 

Methods

unsafeInnerSlice :: Array M Ix1 e -> (Lower Ix1, Int) -> 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 # 

Methods

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

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

OuterSlice M Ix1 e Source # 
Index ix => Load M ix e Source # 

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 #

Index ix => Source M ix e Source # 

Methods

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

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

Index ix => Size M ix e Source # 

Methods

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

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

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

Index ix => Construct M ix e Source # 

Methods

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

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

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

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

Row-major sequential folding over a Manifest array.

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 #

data Array M Source # 
data Array M = MArray {}
type EltRepr M ix Source # 
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 # 

Methods

showsPrec :: Int -> B -> ShowS #

show :: B -> String #

showList :: [B] -> ShowS #

Index ix => Mutable B ix e Source # 

Associated Types

data MArray s B ix e :: * Source #

Methods

msize :: MArray s B ix e -> 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 => ix -> m (MArray (PrimState m) B ix e) Source #

unsafeNewZero :: PrimMonad m => 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 #

Index ix => Manifest B ix e Source # 

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 # 

Methods

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

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 # 

Methods

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

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

Index ix => Size B ix e Source # 

Methods

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

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

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

Index ix => Construct B ix e Source # 

Methods

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

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

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

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

Row-major sequential folding over a Boxed array.

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 # 

Associated Types

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

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 # 

Methods

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

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

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

Methods

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

data Array B Source # 
data Array B = BArray {}
type VRepr B Source # 
type VRepr B = Vector
data MArray s B Source # 
data MArray s B = MBArray !ix !(MutableArray s e)
type EltRepr B ix Source # 
type EltRepr B ix = M
type Item (Array B ix e) Source # 
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 # 

Methods

showsPrec :: Int -> N -> ShowS #

show :: N -> String #

showList :: [N] -> ShowS #

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

Associated Types

data MArray s N ix e :: * Source #

Methods

msize :: MArray s N ix e -> 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 => ix -> m (MArray (PrimState m) N ix e) Source #

unsafeNewZero :: PrimMonad m => 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 #

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

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 # 

Methods

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

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 # 

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 # 

Methods

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

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

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

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

Methods

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

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

unsafeMakeArray :: Comp -> 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 # 

Associated Types

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

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 # 

Methods

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

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

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

Methods

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

data Array N Source # 
data Array N = NArray {}
type VRepr N Source # 
type VRepr N = Vector
data MArray s N Source # 
data MArray s N = MNArray !ix !(MutableArray s e)
type EltRepr N ix Source # 
type EltRepr N ix = M
type Item (Array N ix e) Source # 
type Item (Array N ix e) = Item (Array L ix e)

Primitive

data P Source #

Representation for Primitive elements

Constructors

P 

Instances

Show P Source # 

Methods

showsPrec :: Int -> P -> ShowS #

show :: P -> String #

showList :: [P] -> ShowS #

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

Associated Types

data MArray s P ix e :: * Source #

Methods

msize :: MArray s P ix e -> 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 => ix -> m (MArray (PrimState m) P ix e) Source #

unsafeNewZero :: PrimMonad m => 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 #

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

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 # 

Methods

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

Prim e => Slice P Ix1 e Source # 

Methods

unsafeSlice :: Array P Ix1 e -> Ix1 -> 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 # 

Methods

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

Prim e => InnerSlice P Ix1 e Source # 

Methods

unsafeInnerSlice :: Array P Ix1 e -> (Lower Ix1, Int) -> 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 # 

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 # 
(Prim e, Index ix) => Source P ix e Source # 

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 # 

Methods

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

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

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

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

Methods

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

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

unsafeMakeArray :: Comp -> 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 # 

Associated Types

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

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 # 

Methods

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

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

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

Methods

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

data Array P Source # 
data Array P = PArray {}
type VRepr P Source # 
type VRepr P = Vector
data MArray s P Source # 
data MArray s P = MPArray !ix !(MutableByteArray s)
type EltRepr P ix Source # 
type EltRepr P ix = M
type Item (Array P ix e) Source # 
type Item (Array P ix e) = Item (Array L ix e)

class Prim a #

Class of types supporting primitive array operations

Instances

Prim Char 
Prim Double 
Prim Float 
Prim Int 
Prim Int8 
Prim Int16 
Prim Int32 
Prim Int64 
Prim Word 
Prim Word8 
Prim Word16 
Prim Word32 
Prim Word64 
Prim Addr 
Prim (Ptr a) 
Prim (FunPtr a) 

Storable

data S Source #

Representation for Storable elements

Constructors

S 

Instances

Show S Source # 

Methods

showsPrec :: Int -> S -> ShowS #

show :: S -> String #

showList :: [S] -> ShowS #

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

Associated Types

data MArray s S ix e :: * Source #

Methods

msize :: MArray s S ix e -> 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 => ix -> m (MArray (PrimState m) S ix e) Source #

unsafeNewZero :: PrimMonad m => 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 #

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

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 # 

Methods

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

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 # 

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 # 

Methods

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

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

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

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

Methods

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

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

unsafeMakeArray :: Comp -> 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 # 

Associated Types

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

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 # 

Methods

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

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

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

Methods

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

data Array S Source # 
data Array S = SArray {}
type VRepr S Source # 
type VRepr S = Vector
data MArray s S Source # 
data MArray s S = MSArray !ix !(MVector s e)
type EltRepr S ix Source # 
type EltRepr S ix = M
type Item (Array S ix e) Source # 
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: 2.1

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: 2.1

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: 2.1

Storable Float

Since: 2.1

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: 2.1

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: 2.1

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: 2.1

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: 2.1

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: 2.1

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: 2.1

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: 2.1

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: 2.1

Storable Word32

Since: 2.1

Storable Word64

Since: 2.1

Storable ()

Since: 4.9.0.0

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 

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 
Storable CUChar 
Storable CShort 
Storable CUShort 
Storable CInt 

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 

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 

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 
Storable CLLong 
Storable CULLong 
Storable CBool 

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 
Storable CDouble 
Storable CPtrdiff 
Storable CSize 

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 
Storable CSigAtomic 
Storable CClock 
Storable CTime 

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 
Storable CSUSeconds 
Storable CIntPtr 
Storable CUIntPtr 
Storable CIntMax 
Storable CUIntMax 
Storable Fingerprint

Since: 4.4.0.0

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

Since: 4.8.0.0

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: 2.1

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: 2.1

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: 2.1

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: 4.8.0.0

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) 

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 () #

Storable a => Storable (Const k a b) 

Methods

sizeOf :: Const k a b -> Int #

alignment :: Const k a b -> Int #

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

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

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

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

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

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

Unboxed

data U Source #

Representation for Unboxed elements

Constructors

U 

Instances

Show U Source # 

Methods

showsPrec :: Int -> U -> ShowS #

show :: U -> String #

showList :: [U] -> ShowS #

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

Associated Types

data MArray s U ix e :: * Source #

Methods

msize :: MArray s U ix e -> 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 => ix -> m (MArray (PrimState m) U ix e) Source #

unsafeNewZero :: PrimMonad m => 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 #

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

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 # 

Methods

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

Unbox e => Slice U Ix1 e Source # 

Methods

unsafeSlice :: Array U Ix1 e -> Ix1 -> 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 # 

Methods

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

Unbox e => InnerSlice U Ix1 e Source # 

Methods

unsafeInnerSlice :: Array U Ix1 e -> (Lower Ix1, Int) -> 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 # 

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 # 
(Unbox e, Index ix) => Source U ix e Source # 

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 # 

Methods

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

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

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

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

Methods

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

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

unsafeMakeArray :: Comp -> 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 # 

Associated Types

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

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 # 

Methods

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

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

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

Methods

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

data Array U Source # 
data Array U = UArray {}
type VRepr U Source # 
type VRepr U = Vector
data MArray s U Source # 
data MArray s U = MUArray ix (MVector s e)
type EltRepr U ix Source # 
type EltRepr U ix = M
type Item (Array U ix e) Source # 
type Item (Array U ix e) = Item (Array L ix e)

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

Instances

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 Ix2.

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

Unboxing of a IxN.

(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)