sized-grid-0.1.1.5: Multidimensional grids with sized specified at compile time

Safe HaskellNone
LanguageHaskell2010

SizedGrid.Grid.Focused

Synopsis

Documentation

data FocusedGrid cs a Source #

Similar to Grid, but this has a focus on a certain square. Becuase of this we loose some instances, such as Applicative, but we gain a Comonad and ComonadStore instance. We can convert between a focused and unfocused list using facilites in IsGrid

Constructors

FocusedGrid 

Fields

Instances
(AllSizedKnown cs, All IsCoord cs) => IsGrid cs (FocusedGrid cs) Source # 
Instance details

Defined in SizedGrid.Grid.Class

Functor (FocusedGrid cs) Source # 
Instance details

Defined in SizedGrid.Grid.Focused

Methods

fmap :: (a -> b) -> FocusedGrid cs a -> FocusedGrid cs b #

(<$) :: a -> FocusedGrid cs b -> FocusedGrid cs a #

Foldable (FocusedGrid cs) Source # 
Instance details

Defined in SizedGrid.Grid.Focused

Methods

fold :: Monoid m => FocusedGrid cs m -> m #

foldMap :: Monoid m => (a -> m) -> FocusedGrid cs a -> m #

foldr :: (a -> b -> b) -> b -> FocusedGrid cs a -> b #

foldr' :: (a -> b -> b) -> b -> FocusedGrid cs a -> b #

foldl :: (b -> a -> b) -> b -> FocusedGrid cs a -> b #

foldl' :: (b -> a -> b) -> b -> FocusedGrid cs a -> b #

foldr1 :: (a -> a -> a) -> FocusedGrid cs a -> a #

foldl1 :: (a -> a -> a) -> FocusedGrid cs a -> a #

toList :: FocusedGrid cs a -> [a] #

null :: FocusedGrid cs a -> Bool #

length :: FocusedGrid cs a -> Int #

elem :: Eq a => a -> FocusedGrid cs a -> Bool #

maximum :: Ord a => FocusedGrid cs a -> a #

minimum :: Ord a => FocusedGrid cs a -> a #

sum :: Num a => FocusedGrid cs a -> a #

product :: Num a => FocusedGrid cs a -> a #

Traversable (FocusedGrid cs) Source # 
Instance details

Defined in SizedGrid.Grid.Focused

Methods

traverse :: Applicative f => (a -> f b) -> FocusedGrid cs a -> f (FocusedGrid cs b) #

sequenceA :: Applicative f => FocusedGrid cs (f a) -> f (FocusedGrid cs a) #

mapM :: Monad m => (a -> m b) -> FocusedGrid cs a -> m (FocusedGrid cs b) #

sequence :: Monad m => FocusedGrid cs (m a) -> m (FocusedGrid cs a) #

(AllSizedKnown cs, All IsCoord cs, All Monoid cs, All Semigroup cs, SListI cs) => Comonad (FocusedGrid cs) Source # 
Instance details

Defined in SizedGrid.Grid.Focused

Methods

extract :: FocusedGrid cs a -> a #

duplicate :: FocusedGrid cs a -> FocusedGrid cs (FocusedGrid cs a) #

extend :: (FocusedGrid cs a -> b) -> FocusedGrid cs a -> FocusedGrid cs b #

(AllSizedKnown cs, All IsCoord cs, All Monoid cs, All Semigroup cs, SListI cs) => ComonadStore (Coord cs) (FocusedGrid cs) Source # 
Instance details

Defined in SizedGrid.Grid.Focused

Methods

pos :: FocusedGrid cs a -> Coord cs #

peek :: Coord cs -> FocusedGrid cs a -> a #

peeks :: (Coord cs -> Coord cs) -> FocusedGrid cs a -> a #

seek :: Coord cs -> FocusedGrid cs a -> FocusedGrid cs a #

seeks :: (Coord cs -> Coord cs) -> FocusedGrid cs a -> FocusedGrid cs a #

experiment :: Functor f => (Coord cs -> f (Coord cs)) -> FocusedGrid cs a -> f a #