Safe Haskell | None |
---|---|
Language | Haskell2010 |
Arrays, based on Data.Vector.Unboxed, indexed by Point
.
- data GArray w c = Array {}
- type Array c = GArray Word8 c
- pindex :: X -> Point -> Int
- punindex :: X -> Int -> Point
- (!) :: (Unbox w, Enum w, Enum c) => GArray w c -> Point -> c
- accessI :: Unbox w => GArray w c -> Int -> w
- (//) :: (Unbox w, Enum w, Enum c) => GArray w c -> [(Point, c)] -> GArray w c
- replicateA :: (Unbox w, Enum w, Enum c) => X -> Y -> c -> GArray w c
- replicateMA :: (Unbox w, Enum w, Enum c, Monad m) => X -> Y -> m c -> m (GArray w c)
- generateA :: (Unbox w, Enum w, Enum c) => X -> Y -> (Point -> c) -> GArray w c
- generateMA :: (Unbox w, Enum w, Enum c, Monad m) => X -> Y -> (Point -> m c) -> m (GArray w c)
- unfoldrNA :: (Unbox w, Enum w, Enum c) => X -> Y -> (b -> (c, b)) -> b -> GArray w c
- sizeA :: GArray w c -> (X, Y)
- foldrA :: (Unbox w, Enum w, Enum c) => (c -> a -> a) -> a -> GArray w c -> a
- foldrA' :: (Unbox w, Enum w, Enum c) => (c -> a -> a) -> a -> GArray w c -> a
- foldlA' :: (Unbox w, Enum w, Enum c) => (a -> c -> a) -> a -> GArray w c -> a
- ifoldrA :: (Unbox w, Enum w, Enum c) => (Point -> c -> a -> a) -> a -> GArray w c -> a
- ifoldrA' :: (Unbox w, Enum w, Enum c) => (Point -> c -> a -> a) -> a -> GArray w c -> a
- ifoldlA' :: (Unbox w, Enum w, Enum c) => (a -> Point -> c -> a) -> a -> GArray w c -> a
- foldMA' :: (Monad m, Unbox w, Enum w, Enum c) => (a -> c -> m a) -> a -> GArray w c -> m a
- ifoldMA' :: (Monad m, Unbox w, Enum w, Enum c) => (a -> Point -> c -> m a) -> a -> GArray w c -> m a
- mapA :: (Unbox w1, Enum w1, Unbox w2, Enum w2, Enum c, Enum d) => (c -> d) -> GArray w1 c -> GArray w2 d
- imapA :: (Unbox w1, Enum w1, Unbox w2, Enum w2, Enum c, Enum d) => (Point -> c -> d) -> GArray w1 c -> GArray w2 d
- imapMA_ :: (Unbox w, Enum w, Enum c, Monad m) => (Point -> c -> m ()) -> GArray w c -> m ()
- safeSetA :: (Unbox w, Enum w, Enum c) => c -> GArray w c -> GArray w c
- unsafeSetA :: (Unbox w, Enum w, Enum c) => c -> GArray w c -> GArray w c
- unsafeUpdateA :: (Unbox w, Enum w, Enum c) => GArray w c -> [(Point, c)] -> ()
- unsafeWriteA :: (Unbox w, Enum w, Enum c) => GArray w c -> Point -> c -> ()
- unsafeWriteManyA :: (Unbox w, Enum w, Enum c) => GArray w c -> [Point] -> c -> ()
- minIndexA :: (Unbox w, Ord w) => GArray w c -> Point
- minLastIndexA :: (Unbox w, Ord w) => GArray w c -> Point
- minIndexesA :: (Unbox w, Enum w, Ord w) => GArray w c -> [Point]
- maxIndexA :: (Unbox w, Ord w) => GArray w c -> Point
- maxLastIndexA :: (Unbox w, Ord w) => GArray w c -> Point
- forceA :: Unbox w => GArray w c -> GArray w c
- fromListA :: (Unbox w, Enum w, Enum c) => X -> Y -> [c] -> GArray w c
- toListA :: (Unbox w, Enum w, Enum c) => GArray w c -> [c]
Documentation
Arrays indexed by Point
.
(//) :: (Unbox w, Enum w, Enum c) => GArray w c -> [(Point, c)] -> GArray w c Source #
Construct an array updated with the association list.
replicateA :: (Unbox w, Enum w, Enum c) => X -> Y -> c -> GArray w c Source #
Create an array from a replicated element.
replicateMA :: (Unbox w, Enum w, Enum c, Monad m) => X -> Y -> m c -> m (GArray w c) Source #
Create an array from a replicated monadic action.
generateA :: (Unbox w, Enum w, Enum c) => X -> Y -> (Point -> c) -> GArray w c Source #
Create an array from a function.
generateMA :: (Unbox w, Enum w, Enum c, Monad m) => X -> Y -> (Point -> m c) -> m (GArray w c) Source #
Create an array from a monadic function.
foldrA :: (Unbox w, Enum w, Enum c) => (c -> a -> a) -> a -> GArray w c -> a Source #
Fold right over an array.
foldrA' :: (Unbox w, Enum w, Enum c) => (c -> a -> a) -> a -> GArray w c -> a Source #
Fold right strictly over an array.
foldlA' :: (Unbox w, Enum w, Enum c) => (a -> c -> a) -> a -> GArray w c -> a Source #
Fold left strictly over an array.
ifoldrA :: (Unbox w, Enum w, Enum c) => (Point -> c -> a -> a) -> a -> GArray w c -> a Source #
Fold right over an array (function applied to each element and its index).
ifoldrA' :: (Unbox w, Enum w, Enum c) => (Point -> c -> a -> a) -> a -> GArray w c -> a Source #
Fold right strictly over an array (function applied to each element and its index).
ifoldlA' :: (Unbox w, Enum w, Enum c) => (a -> Point -> c -> a) -> a -> GArray w c -> a Source #
Fold left strictly over an array (function applied to each element and its index).
foldMA' :: (Monad m, Unbox w, Enum w, Enum c) => (a -> c -> m a) -> a -> GArray w c -> m a Source #
Fold monadically strictly over an array.
ifoldMA' :: (Monad m, Unbox w, Enum w, Enum c) => (a -> Point -> c -> m a) -> a -> GArray w c -> m a Source #
Fold monadically strictly over an array (function applied to each element and its index).
mapA :: (Unbox w1, Enum w1, Unbox w2, Enum w2, Enum c, Enum d) => (c -> d) -> GArray w1 c -> GArray w2 d Source #
Map over an array.
imapA :: (Unbox w1, Enum w1, Unbox w2, Enum w2, Enum c, Enum d) => (Point -> c -> d) -> GArray w1 c -> GArray w2 d Source #
Map over an array (function applied to each element and its index).
imapMA_ :: (Unbox w, Enum w, Enum c, Monad m) => (Point -> c -> m ()) -> GArray w c -> m () Source #
Map monadically over an array (function applied to each element and its index) and ignore the results.
safeSetA :: (Unbox w, Enum w, Enum c) => c -> GArray w c -> GArray w c Source #
Set all elements to the given value, in place, if possible.
unsafeSetA :: (Unbox w, Enum w, Enum c) => c -> GArray w c -> GArray w c Source #
Set all elements to the given value, in place.
minIndexA :: (Unbox w, Ord w) => GArray w c -> Point Source #
Yield the point coordinates of a minimum element of the array. The array may not be empty.
minLastIndexA :: (Unbox w, Ord w) => GArray w c -> Point Source #
Yield the point coordinates of the last minimum element of the array. The array may not be empty.
minIndexesA :: (Unbox w, Enum w, Ord w) => GArray w c -> [Point] Source #
Yield the point coordinates of all the minimum elements of the array. The array may not be empty.
maxIndexA :: (Unbox w, Ord w) => GArray w c -> Point Source #
Yield the point coordinates of the first maximum element of the array. The array may not be empty.
maxLastIndexA :: (Unbox w, Ord w) => GArray w c -> Point Source #
Yield the point coordinates of the last maximum element of the array. The array may not be empty.