Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data Array a = Array {}
- data MutableArray s a = MutableArray {
- marray# :: MutableArray# s a
- newArray :: (HasCallStack, PrimMonad m) => Int -> a -> m (MutableArray (PrimState m) a)
- readArray :: (HasCallStack, PrimMonad m) => MutableArray (PrimState m) a -> Int -> m a
- writeArray :: (HasCallStack, PrimMonad m) => MutableArray (PrimState m) a -> Int -> a -> m ()
- indexArray :: HasCallStack => Array a -> Int -> a
- indexArrayM :: HasCallStack => Monad m => Array a -> Int -> m a
- freezeArray :: (HasCallStack, PrimMonad m) => MutableArray (PrimState m) a -> Int -> Int -> m (Array a)
- thawArray :: (HasCallStack, PrimMonad m) => Array a -> Int -> Int -> m (MutableArray (PrimState m) a)
- unsafeFreezeArray :: PrimMonad m => MutableArray (PrimState m) a -> m (Array a)
- unsafeThawArray :: PrimMonad m => Array a -> m (MutableArray (PrimState m) a)
- sameMutableArray :: MutableArray s a -> MutableArray s a -> Bool
- copyArray :: (HasCallStack, PrimMonad m) => MutableArray (PrimState m) a -> Int -> Array a -> Int -> Int -> m ()
- copyMutableArray :: (HasCallStack, PrimMonad m) => MutableArray (PrimState m) a -> Int -> MutableArray (PrimState m) a -> Int -> Int -> m ()
- cloneArray :: HasCallStack => Array a -> Int -> Int -> Array a
- cloneMutableArray :: (HasCallStack, PrimMonad m) => MutableArray (PrimState m) a -> Int -> Int -> m (MutableArray (PrimState m) a)
- sizeofArray :: Array a -> Int
- sizeofMutableArray :: MutableArray s a -> Int
Documentation
Boxed arrays
Instances
Monad Array | |
Functor Array | |
MonadFix Array | |
Defined in Data.Primitive.Array | |
Applicative Array | |
Foldable Array | |
Defined in Data.Primitive.Array fold :: Monoid m => Array m -> m # foldMap :: Monoid m => (a -> m) -> Array a -> m # foldr :: (a -> b -> b) -> b -> Array a -> b # foldr' :: (a -> b -> b) -> b -> Array a -> b # foldl :: (b -> a -> b) -> b -> Array a -> b # foldl' :: (b -> a -> b) -> b -> Array a -> b # foldr1 :: (a -> a -> a) -> Array a -> a # foldl1 :: (a -> a -> a) -> Array a -> a # elem :: Eq a => a -> Array a -> Bool # maximum :: Ord a => Array a -> a # minimum :: Ord a => Array a -> a # | |
Traversable Array | |
Eq1 Array | Since: primitive-0.6.4.0 |
Ord1 Array | Since: primitive-0.6.4.0 |
Defined in Data.Primitive.Array | |
Read1 Array | Since: primitive-0.6.4.0 |
Defined in Data.Primitive.Array | |
Show1 Array | Since: primitive-0.6.4.0 |
MonadZip Array | |
Alternative Array | |
MonadPlus Array | |
IsList (Array a) | |
Eq a => Eq (Array a) | |
Data a => Data (Array a) | |
Defined in Data.Primitive.Array gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Array a -> c (Array a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Array a) # toConstr :: Array a -> Constr # dataTypeOf :: Array a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Array a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Array a)) # gmapT :: (forall b. Data b => b -> b) -> Array a -> Array a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Array a -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Array a -> r # gmapQ :: (forall d. Data d => d -> u) -> Array a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Array a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Array a -> m (Array a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Array a -> m (Array a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Array a -> m (Array a) # | |
Ord a => Ord (Array a) | Lexicographic ordering. Subject to change between major versions. |
Read a => Read (Array a) | |
Show a => Show (Array a) | |
Semigroup (Array a) | Since: primitive-0.6.3.0 |
Monoid (Array a) | |
PrimUnlifted (Array a) | |
Defined in Data.Primitive.UnliftedArray toArrayArray# :: Array a -> ArrayArray# # fromArrayArray# :: ArrayArray# -> Array a # | |
type Item (Array a) | |
Defined in Data.Primitive.Array |
data MutableArray s a #
Mutable boxed arrays associated with a primitive state token.
MutableArray | |
|
Instances
Eq (MutableArray s a) | |
Defined in Data.Primitive.Array (==) :: MutableArray s a -> MutableArray s a -> Bool # (/=) :: MutableArray s a -> MutableArray s a -> Bool # | |
(Typeable s, Typeable a) => Data (MutableArray s a) | |
Defined in Data.Primitive.Array gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> MutableArray s a -> c (MutableArray s a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (MutableArray s a) # toConstr :: MutableArray s a -> Constr # dataTypeOf :: MutableArray s a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (MutableArray s a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (MutableArray s a)) # gmapT :: (forall b. Data b => b -> b) -> MutableArray s a -> MutableArray s a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> MutableArray s a -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> MutableArray s a -> r # gmapQ :: (forall d. Data d => d -> u) -> MutableArray s a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> MutableArray s a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> MutableArray s a -> m (MutableArray s a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> MutableArray s a -> m (MutableArray s a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> MutableArray s a -> m (MutableArray s a) # | |
PrimUnlifted (MutableArray s a) | |
Defined in Data.Primitive.UnliftedArray toArrayArray# :: MutableArray s a -> ArrayArray# # fromArrayArray# :: ArrayArray# -> MutableArray s a # |
newArray :: (HasCallStack, PrimMonad m) => Int -> a -> m (MutableArray (PrimState m) a) Source #
readArray :: (HasCallStack, PrimMonad m) => MutableArray (PrimState m) a -> Int -> m a Source #
writeArray :: (HasCallStack, PrimMonad m) => MutableArray (PrimState m) a -> Int -> a -> m () Source #
indexArray :: HasCallStack => Array a -> Int -> a Source #
indexArrayM :: HasCallStack => Monad m => Array a -> Int -> m a Source #
:: (HasCallStack, PrimMonad m) | |
=> MutableArray (PrimState m) a | source |
-> Int | offset |
-> Int | length |
-> m (Array a) |
:: (HasCallStack, PrimMonad m) | |
=> Array a | source |
-> Int | offset |
-> Int | length |
-> m (MutableArray (PrimState m) a) |
unsafeFreezeArray :: PrimMonad m => MutableArray (PrimState m) a -> m (Array a) #
Convert a mutable array to an immutable one without copying. The array should not be modified after the conversion.
unsafeThawArray :: PrimMonad m => Array a -> m (MutableArray (PrimState m) a) #
Convert an immutable array to an mutable one without copying. The immutable array should not be used after the conversion.
sameMutableArray :: MutableArray s a -> MutableArray s a -> Bool #
Check whether the two arrays refer to the same memory block.
:: (HasCallStack, PrimMonad m) | |
=> MutableArray (PrimState m) a | destination array |
-> Int | offset into destination array |
-> Array a | source array |
-> Int | offset into source array |
-> Int | number of elements to copy |
-> m () |
:: (HasCallStack, PrimMonad m) | |
=> MutableArray (PrimState m) a | destination array |
-> Int | offset into destination array |
-> MutableArray (PrimState m) a | source array |
-> Int | offset into source array |
-> Int | number of elements to copy |
-> m () |
:: HasCallStack | |
=> Array a | source array |
-> Int | offset into destination array |
-> Int | number of elements to copy |
-> Array a |
:: (HasCallStack, PrimMonad m) | |
=> MutableArray (PrimState m) a | source array |
-> Int | offset into destination array |
-> Int | number of elements to copy |
-> m (MutableArray (PrimState m) a) |
sizeofArray :: Array a -> Int #
sizeofMutableArray :: MutableArray s a -> Int #