LambdaHack-0.10.3.0: A game engine library for tactical squad ASCII roguelike dungeon crawlers
Safe HaskellNone
LanguageHaskell2010

Game.LambdaHack.Common.PointArray

Description

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

Synopsis

Documentation

class (Ord c, Eq (UnboxRep c), Ord (UnboxRep c), Bounded (UnboxRep c), Binary (UnboxRep c), Unbox (UnboxRep c)) => UnboxRepClass c where Source #

Associated Types

type UnboxRep c Source #

type UnboxRep c = c

data Array c Source #

Arrays indexed by Point.

Constructors

Array 

Fields

Instances

Instances details
UnboxRepClass c => Eq (Array c) Source # 
Instance details

Defined in Game.LambdaHack.Common.PointArray

Methods

(==) :: Array c -> Array c -> Bool #

(/=) :: Array c -> Array c -> Bool #

Show (Array c) Source # 
Instance details

Defined in Game.LambdaHack.Common.PointArray

Methods

showsPrec :: Int -> Array c -> ShowS #

show :: Array c -> String #

showList :: [Array c] -> ShowS #

UnboxRepClass c => Binary (Array c) Source # 
Instance details

Defined in Game.LambdaHack.Common.PointArray

Methods

put :: Array c -> Put #

get :: Get (Array c) #

putList :: [Array c] -> Put #

(!) :: UnboxRepClass c => Array c -> Point -> c Source #

Array lookup.

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

Construct an array updated with the association list.

replicateA :: UnboxRepClass c => X -> Y -> c -> Array c Source #

Create an array from a replicated element.

unfoldrNA :: UnboxRepClass c => X -> Y -> (b -> (c, b)) -> b -> Array c Source #

foldrA :: UnboxRepClass c => (c -> a -> a) -> a -> Array c -> a Source #

Fold right over an array.

foldrA' :: UnboxRepClass c => (c -> a -> a) -> a -> Array c -> a Source #

Fold right strictly over an array.

foldlA' :: UnboxRepClass c => (a -> c -> a) -> a -> Array c -> a Source #

Fold left strictly over an array.

ifoldlA' :: UnboxRepClass c => (a -> Point -> c -> a) -> a -> Array c -> a Source #

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

ifoldrA' :: UnboxRepClass c => (Point -> c -> a -> a) -> a -> Array c -> a Source #

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

foldMA' :: (Monad m, UnboxRepClass c) => (a -> c -> m a) -> a -> Array c -> m a Source #

Fold monadically strictly over an array.

mapA :: (UnboxRepClass c, UnboxRepClass d) => (c -> d) -> Array c -> Array d Source #

Map over an array.

imapA :: (UnboxRepClass c, UnboxRepClass d) => (Point -> c -> d) -> Array c -> Array d Source #

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

imapMA_ :: (Monad m, UnboxRepClass c) => (Point -> c -> m ()) -> Array c -> m () Source #

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

minIndexesA :: UnboxRepClass c => Array c -> [Point] Source #

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

maxIndexA :: UnboxRepClass c => Array c -> Point Source #

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

maxIndexByA :: UnboxRepClass c => (c -> c -> Ordering) -> Array c -> Point Source #

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

maxLastIndexA :: UnboxRepClass c => Array c -> Point Source #

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

Internal operations