Safe Haskell | None |
---|---|

Language | Haskell2010 |

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)
- generateA :: Enum c => X -> Y -> (Point -> c) -> 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
- mapA :: (Enum c, Enum d) => (c -> d) -> Array c -> Array d
- imapA :: (Enum c, Enum d) => (Point -> c -> d) -> Array c -> Array d
- mapWithKeyMA :: Enum c => Monad m => (Point -> c -> m ()) -> Array c -> m ()
- safeSetA :: Enum c => c -> Array c -> Array c
- unsafeSetA :: Enum c => c -> Array c -> Array c
- unsafeUpdateA :: Enum c => Array c -> [(Point, c)] -> Array c
- minIndexA :: Enum c => Array c -> Point
- minLastIndexA :: Enum c => Array c -> Point
- minIndexesA :: Enum c => Array c -> [Point]
- maxIndexA :: Enum c => Array c -> Point
- maxLastIndexA :: Enum c => Array c -> Point
- forceA :: Enum c => Array c -> Array c

# Documentation

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

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 -> a Source

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 d Source

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

mapWithKeyMA :: Enum c => Monad m => (Point -> c -> m ()) -> Array c -> m () Source

Map monadically over an array (function applied to each element and its index) and ignore the results.

safeSetA :: Enum c => c -> Array c -> Array c Source

Set all elements to the given value, in place, if possible.

unsafeSetA :: Enum c => c -> Array c -> Array c Source

Set all elements to the given value, in place.

minIndexA :: Enum c => Array c -> Point Source

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

minLastIndexA :: Enum c => Array c -> Point Source

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

minIndexesA :: Enum c => Array c -> [Point] Source

Yield the point coordinates of all the minimum elements of the array. The array may not be empty.

maxIndexA :: Enum c => Array c -> Point Source

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

maxLastIndexA :: Enum c => Array c -> Point Source

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