| License | MIT |
|---|---|
| Maintainer | Jonatan H Sundqvist |
| Stability | experimental|stable |
| Portability | POSIX (not sure) |
| Safe Haskell | None |
| Language | Haskell2010 |
Cartesian.Types
Description
- newtype V1 a :: * -> * = V1 a
- data V2 a :: * -> * = V2 ~a ~a
- data V3 a :: * -> * = V3 ~a ~a ~a
- data V4 a :: * -> * = V4 ~a ~a ~a ~a
- data Complex a :: * -> * = ~a :+ ~a
- type BoxLens v v' f f' = Lens (BoundingBox (v f)) (BoundingBox (v' f')) f f'
- type Axis a = (a, a)
- type Axes v a = v (Axis a)
- type Polygon m v f = m (v f)
- data Normalised v
- data Absolute v
- data BoundingBox v = BoundingBox {}
- data Line v
- data Linear f
- class HasX a f | a -> f
- class HasY a f | a -> f
- class HasZ a f | a -> f
Documentation
Third party types
A 1-dimensional vector
>>>pure 1 :: V1 IntV1 1
>>>V1 2 + V1 3V1 5
>>>V1 2 * V1 3V1 6
>>>sum (V1 2)2
Constructors
| V1 a |
Instances
A 2-dimensional vector
>>>pure 1 :: V2 IntV2 1 1
>>>V2 1 2 + V2 3 4V2 4 6
>>>V2 1 2 * V2 3 4V2 3 8
>>>sum (V2 1 2)3
Constructors
| V2 ~a ~a |
Instances
A 3-dimensional vector
Constructors
| V3 ~a ~a ~a |
Instances
A 4-dimensional vector.
Constructors
| V4 ~a ~a ~a ~a |
Instances
Complex numbers are an algebraic type.
For a complex number z, is a number with the magnitude of abs zz,
but oriented in the positive real direction, whereas
has the phase of signum zz, but unit magnitude.
The Foldable and Traversable instances traverse the real part first.
Constructors
| ~a :+ ~a infix 6 | forms a complex number from its real and imaginary rectangular components. |
Instances
| Monad Complex | |
| Functor Complex | |
| Applicative Complex | |
| Foldable Complex | |
| Traversable Complex | |
| Generic1 Complex | |
| Representable Complex | |
| Additive Complex | |
| Unbox a => Vector Vector (Complex a) | |
| Unbox a => MVector MVector (Complex a) | |
| Eq a => Eq (Complex a) | |
| RealFloat a => Floating (Complex a) | |
| RealFloat a => Fractional (Complex a) | |
| Data a => Data (Complex a) | |
| RealFloat a => Num (Complex a) | |
| Read a => Read (Complex a) | |
| Show a => Show (Complex a) | |
| Generic (Complex a) | |
| Storable a => Storable (Complex a) | |
| Unbox a => Unbox (Complex a) | |
| HasY (Complex f) f Source # | |
| HasX (Complex f) f Source # | |
| type Rep1 Complex | |
| type Rep Complex | |
| data MVector s (Complex a) | |
| type Rep (Complex a) | |
| data Vector (Complex a) | |
| type Index (Complex a) | |
Synonyms
type BoxLens v v' f f' = Lens (BoundingBox (v f)) (BoundingBox (v' f')) f f' Source #
A lens focusing on a single [vector-]component in a BoundingBox
type Axes v a = v (Axis a) Source #
A vector where each component represents a single axis (cf. Axis)
Coordinate types
data Normalised v Source #
Coordinate system wrappers
Types defined in this library
data BoundingBox v Source #
TODO: Anchors (eg. C, N, S, E W and combinations thereof, perhaps represented as relative Vectors) TODO: Define some standard instances (eg. Functor, Applicative)
Constructors
| BoundingBox | |
Instances
| Eq v => Eq (BoundingBox v) Source # | |
| Show v => Show (BoundingBox v) Source # | |
TODO: Use record (eg. from, to) (?)
Classes
class HasX a f | a -> f Source #
TODO: Use existing type instead (?) data Side = SideLeft | SideRight | SideTop | SideBottom
Minimal complete definition