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

Safe HaskellNone
LanguageHaskell2010

SizedGrid.Coord.Class

Synopsis

Documentation

class (1 <= CoordSized c, KnownNat (CoordSized c)) => IsCoord c where Source #

Everything that can be uses as a Coordinate. The only required function is asOrdinal and the type instance of CoordSized: the rest can be derived automatically.

This is kind * -> Constraint for ease of use later. There is some argument that it should be of kind (Nat -> *) -> Constraint and we could remove CoordSized, but that has other complications

Minimal complete definition

asOrdinal

Associated Types

type CoordSized c :: Nat Source #

The maximum number of values that a Coord can take

Methods

asOrdinal :: Iso' c (Ordinal (CoordSized c)) Source #

As each coord represents a finite number of states, it must be isomorphic to an Ordinal

zeroPosition :: c Source #

The origin. If c is an instance of Monoid, this should be mempty

zeroPosition :: Monoid c => c Source #

The origin. If c is an instance of Monoid, this should be mempty

sCoordSized :: proxy c -> Proxy (CoordSized c) Source #

Retrive a Proxy of the size

maxCoordSize :: proxy c -> Integer Source #

The largest possible number expressable

Instances

allCoordLike :: IsCoord c => [c] Source #

Enumerate all possible values of a coord, in order