Nice syntax for constructing and pattern-matching on literal points and vectors.
A pair of values, with a convenient infix (left-associative) data constructor.
|a :& b|
Types which are instances of the
Coordinates class can be
& (for example, a three-dimensional vector
could be constructed by
1 & 6 & 3), and deconstructed using
coords. A common pattern is to use
coords in conjunction
ViewPatterns extension, like so:
foo :: Vector3 -> ... foo (coords -> x :& y :& z) = ...
The type of the final coordinate.
The type of everything other than the final coordinate.
c into applications of
Construct a value of type
c by providing something of one
less dimension (which is perhaps itself recursively constructed
(&)) and a final coordinate. For example,
2 & 3 :: P2 3 & 5 & 6 :: R3
& is left-associative.
Decompose a value of type
c into its constituent coordinates,
stored in a nested