Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
A 2-dimensional point.
Documentation
A 2-dim point of a's
A Point is functorial over both arguments, and is a Num instance.
>>>
let p = Point 1 1
>>>
p + p
Point 2 2>>>
(2*) <$> p
Point 2 2
A major reason for this bespoke treatment of a point is that Points do not have maximums and minimums but they form a lattice, and this is useful for folding points to find out the (rectangular) Space they occupy.
>>>
Point 0 1 /\ Point 1 0
Point 0 0>>>
Point 0 1 \/ Point 1 0
Point 1 1
Point a a |