Safe Haskell | None |
---|

Arrays, based on Data.Vector.Unboxed, indexed by `Point`

.

- data Array c
- (!) :: Enum c => Array c -> Point -> c
- (//) :: Enum c => Array c -> [(Point, c)] -> Array c
- replicateA :: Enum c => X -> Y -> c -> Array c
- replicateMA :: Enum c => Monad m => X -> Y -> m c -> m (Array c)
- generateMA :: Enum c => Monad m => X -> Y -> (Point -> m c) -> m (Array c)
- sizeA :: Array c -> (X, Y)
- foldlA :: Enum c => (a -> c -> a) -> a -> Array c -> a
- ifoldlA :: Enum c => (a -> Point -> c -> a) -> a -> Array c -> a
- imapA :: (Enum c, Enum d) => (Point -> c -> d) -> Array c -> Array d
- minIndexA :: Enum c => Array c -> Point
- minLastIndexA :: Enum c => Array c -> Point
- maxIndexA :: Enum c => Array c -> Point
- maxLastIndexA :: Enum c => Array c -> Point

# Documentation

(//) :: Enum c => Array c -> [(Point, c)] -> Array cSource

Construct an array updated with the association list.

replicateMA :: Enum c => Monad m => X -> Y -> m c -> m (Array c)Source

Create an array from a replicated monadic action.

generateMA :: Enum c => Monad m => X -> Y -> (Point -> m c) -> m (Array c)Source

Create an array from a monadic function.

ifoldlA :: Enum c => (a -> Point -> c -> a) -> a -> Array c -> aSource

Fold left strictly over an array (function applied to each element and its index).

imapA :: (Enum c, Enum d) => (Point -> c -> d) -> Array c -> Array dSource

Map over an array (function applied to each element and its index).

minIndexA :: Enum c => Array c -> PointSource

Yield the point coordinates of a minimum element of the array. The array may not be empty.

minLastIndexA :: Enum c => Array c -> PointSource

Yield the point coordinates of the last minimum element of the array. The array may not be empty.

maxIndexA :: Enum c => Array c -> PointSource

Yield the point coordinates of the first maximum element of the array. The array may not be empty.

maxLastIndexA :: Enum c => Array c -> PointSource

Yield the point coordinates of the last maximum element of the array. The array may not be empty.