Safe Haskell | None |
---|---|
Language | Haskell2010 |
- class Contiguous (arr :: Type -> Type) where
- class Always a
- map :: (Contiguous arr, Element arr b, Element arr c) => (b -> c) -> arr b -> arr c
- foldr :: (Contiguous arr, Element arr a) => (a -> b -> b) -> b -> arr a -> b
- foldl' :: (Contiguous arr, Element arr a) => (b -> a -> b) -> b -> arr a -> b
- foldr' :: (Contiguous arr, Element arr a) => (a -> b -> b) -> b -> arr a -> b
- foldMap' :: (Contiguous arr, Element arr a, Monoid m) => (a -> m) -> arr a -> m
- foldlM' :: (Contiguous arr, Element arr a, Monad m) => (b -> a -> m b) -> b -> arr a -> m b
- unsafeFromListN :: (Contiguous arr, Element arr a) => Int -> [a] -> arr a
- unsafeFromListReverseN :: (Contiguous arr, Element arr a) => Int -> [a] -> arr a
Documentation
class Contiguous (arr :: Type -> Type) where Source #
A contiguous array of elements.
empty, new, index, index#, indexM, read, write, resize, size, sizeMutable, unsafeFreeze, copy, copyMutable, clone, cloneMutable, equals, unlift, lift
type Mutable arr = (r :: Type -> Type -> Type) | r -> arr Source #
type Element arr :: Type -> Constraint Source #
new :: Element arr b => Int -> ST s (Mutable arr s b) Source #
index :: Element arr b => arr b -> Int -> b Source #
index# :: Element arr b => arr b -> Int -> (#b#) Source #
indexM :: (Element arr b, Monad m) => arr b -> Int -> m b Source #
read :: Element arr b => Mutable arr s b -> Int -> ST s b Source #
write :: Element arr b => Mutable arr s b -> Int -> b -> ST s () Source #
resize :: Element arr b => Mutable arr s b -> Int -> ST s (Mutable arr s b) Source #
size :: Element arr b => arr b -> Int Source #
sizeMutable :: Element arr b => Mutable arr s b -> ST s Int Source #
unsafeFreeze :: Mutable arr s b -> ST s (arr b) Source #
copy :: Element arr b => Mutable arr s b -> Int -> arr b -> Int -> Int -> ST s () Source #
copyMutable :: Element arr b => Mutable arr s b -> Int -> Mutable arr s b -> Int -> Int -> ST s () Source #
clone :: Element arr b => arr b -> Int -> Int -> arr b Source #
cloneMutable :: Element arr b => Mutable arr s b -> Int -> Int -> ST s (Mutable arr s b) Source #
equals :: (Element arr b, Eq b) => arr b -> arr b -> Bool Source #
unlift :: arr b -> ArrayArray# Source #
lift :: ArrayArray# -> arr b Source #
map :: (Contiguous arr, Element arr b, Element arr c) => (b -> c) -> arr b -> arr c Source #
Map over the elements of an array.
foldr :: (Contiguous arr, Element arr a) => (a -> b -> b) -> b -> arr a -> b Source #
Right fold over the element of an array.
foldl' :: (Contiguous arr, Element arr a) => (b -> a -> b) -> b -> arr a -> b Source #
Strict left fold over the elements of an array.
foldr' :: (Contiguous arr, Element arr a) => (a -> b -> b) -> b -> arr a -> b Source #
Strict right fold over the elements of an array.
foldMap' :: (Contiguous arr, Element arr a, Monoid m) => (a -> m) -> arr a -> m Source #
Strict monoidal fold over the elements of an array.
foldlM' :: (Contiguous arr, Element arr a, Monad m) => (b -> a -> m b) -> b -> arr a -> m b Source #
Strict left monadic fold over the elements of an array.
:: (Contiguous arr, Element arr a) | |
=> Int | length of list |
-> [a] | list |
-> arr a |
Create an array from a list. If the given length does not match the actual length, this function has undefined behavior.
unsafeFromListReverseN :: (Contiguous arr, Element arr a) => Int -> [a] -> arr a Source #
Create an array from a list, reversing the order of the elements. If the given length does not match the actual length, this function has undefined behavior.