discrete-space-map-0.0.4: A discrete space map.

Safe HaskellSafe-Inferred




class Eq p => Pos p where Source

To be a key in the map, a position needs to be convertible to and from a stream of bits.


uncons :: p -> (p, Bool) Source

cons :: (p, Bool) -> p Source

cons . uncons == id 

zero :: p Source

uncons zero == (zero, False)


Pos Integer

1D discrete space

Pos [Bool]

[Bool] is the free instance of Pos.

Pos p => Pos (p, p)

2D discrete space

Pos p => Pos (p, p, p)

3D discrete space

data MapD a Source


MapD a (MapD (a, a)) 

gotoD :: Pos p => p -> p -> (a, MapD a) -> (a, MapD a) Source

tabulateD :: Pos p => (p -> a) -> MapD a Source

cotraverseD :: Functor f => (f a -> b) -> f (MapD a) -> MapD b Source

zipWithKeyD :: Pos p => (p -> a -> b -> c) -> p -> MapD a -> MapD b -> MapD c Source

traverseWithKey1D :: (Pos p, Apply f) => (p -> a -> f b) -> p -> MapD a -> f (MapD b) Source