LambdaHack-0.4.99.0: A game engine library for roguelike dungeon crawlers

Safe HaskellNone

Game.LambdaHack.Common.PointArray

Description

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

Synopsis

Documentation

data Array c Source

Arrays indexed by Point.

Instances

Eq (Array c) 
Show (Array c) 
Binary (Array c) 

(!) :: Enum c => Array c -> Point -> cSource

Array lookup.

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

Construct an array updated with the association list.

replicateA :: Enum c => X -> Y -> c -> Array cSource

Create an array from a replicated element.

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.

sizeA :: Array c -> (X, Y)Source

Content identifiers array size.

foldlA :: Enum c => (a -> c -> a) -> a -> Array c -> aSource

Fold left strictly over an array.

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.