diagrams-core-1.3.0.4: Core libraries for diagrams EDSL

Copyright(c) 2011-2015 diagrams-core team (see LICENSE)
LicenseBSD-style (see LICENSE)
Maintainerdiagrams-discuss@googlegroups.com
Safe HaskellSafe
LanguageHaskell2010

Diagrams.Core.V

Description

Type family for identifying associated vector spaces.

Synopsis

Documentation

type family V a :: * -> * Source

Many sorts of objects have an associated vector space in which they "live". The type function V maps from object types to the associated vector space. The resulting vector space has kind * -> * which means it takes another value (a number) and returns a concrete vector. For example V2 has kind * -> * and V2 Double is a vector.

Instances

type V [a] = V a Source 
type V (Set a) = V a Source 
type V (Split m) = V m Source 
type V (Deletable m) = V m Source 
type V (Option a) = V a Source 
type V (TransInv t) = V t Source 
type V (a -> b) = V b Source 
type V (a, b) = V a Source 
type V (Map k a) = V a Source 
type V (Point v n) = v Source 
type V ((:+:) m n) = V m Source 
type V (Measured n a) = V a Source 
type V (Transformation v n) = v Source 
type V (Style v n) = v Source 
type V (Attribute v n) = v Source 
type V (Trace v n) = v Source 
type V (Envelope v n) = v Source 
type V (a, b, c) = V a Source 
type V (Query v n m) = v Source 
type V (Prim b v n) = v Source 
type V (SubMap b v n m) = v Source 
type V (Subdiagram b v n m) = v Source 
type V (QDiagram b v n m) = v Source 

type family N a :: * Source

The numerical field for the object, the number type used for calculations.

Instances

type N [a] = N a Source 
type N (Set a) = N a Source 
type N (Split m) = N m Source 
type N (Deletable m) = N m Source 
type N (Option a) = N a Source 
type N (TransInv t) = N t Source 
type N (a -> b) = N b Source 
type N (a, b) = N a Source 
type N (Map k a) = N a Source 
type N (Point v n) = n Source 
type N ((:+:) m n) = N m Source 
type N (Measured n a) = N a Source 
type N (Transformation v n) = n Source 
type N (Style v n) = n Source 
type N (Attribute v n) = n Source 
type N (Trace v n) = n Source 
type N (Envelope v n) = n Source 
type N (a, b, c) = N a Source 
type N (Query v n m) = n Source 
type N (Prim b v n) = n Source 
type N (SubMap b v n m) = n Source 
type N (Subdiagram b v n m) = n Source 
type N (QDiagram b v n m) = n Source 

type Vn a = V a (N a) Source

Conveient type alias to retrieve the vector type associated with an object's vector space. This is usually used as Vn a ~ v n where v is the vector space and n is the numerical field.

class (V a ~ v, N a ~ n, Additive v, Num n) => InSpace v n a Source

InSpace v n a means the type a belongs to the vector space v n, where v is Additive and n is a Num.

Instances

((~) (* -> *) (V a) v, (~) * (N a) n, Additive v, Num n) => InSpace v n a Source 

class (V a ~ V b, N a ~ N b) => SameSpace a b Source

SameSpace a b means the types a and b belong to the same vector space v n.

Instances

((~) (* -> *) (V a) (V b), (~) * (N a) (N b)) => SameSpace a b Source