Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- class IsGrid cs grid | grid -> cs where
- gridIndex :: Coord cs -> Lens' (grid a) a
- asGrid :: Lens' (grid a) (Grid cs a)
- asFocusedGrid :: Lens' (grid a) (FocusedGrid cs a)
Documentation
class IsGrid cs grid | grid -> cs where Source #
Conversion between Grid
and FocusedGrid
and access grids at a Coord
gridIndex :: Coord cs -> Lens' (grid a) a Source #
Get the element at a grid location. This is a lens because we know it must exist
asGrid :: Lens' (grid a) (Grid cs a) Source #
Convert to, or run a function over, a Grid
asFocusedGrid :: Lens' (grid a) (FocusedGrid cs a) Source #
Convert to, or run a function over, a FocusedGrid
Instances
(AllSizedKnown cs, All IsCoord cs) => IsGrid cs (FocusedGrid cs) Source # | |
Defined in SizedGrid.Grid.Class gridIndex :: Coord cs -> Lens' (FocusedGrid cs a) a Source # asGrid :: Lens' (FocusedGrid cs a) (Grid cs a) Source # asFocusedGrid :: Lens' (FocusedGrid cs a) (FocusedGrid cs a) Source # | |
(AllSizedKnown cs, All IsCoord cs) => IsGrid cs (Grid cs) Source # | |