plots-0.1.1.3: Diagrams based plotting library
Copyright(C) 2015 Christopher Chalmers
LicenseBSD-style (see the file LICENSE)
MaintainerChristopher Chalmers
Stabilityexperimental
Portabilitynon-portable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Diagrams.Coordinates.Isomorphic

Description

This module defines a class for coordinates that are (loosely) isomorphic to the standard spaces (V2 and V3). This allows plots to accept more data types for plot data.

Synopsis

Type constraints

type Euclidean (v :: Type -> Type) = (HasLinearMap v, HasIndexedBasis v, Metric v) Source #

Umbrella class giving everything needed for working in the space. This is basically V2 or V3 from "linear".

Vector like

class (Euclidean v, Typeable v) => VectorLike v n a | a -> v n where Source #

Provides an Iso' between a and v n. This is normally used to convert between the data type you're already using, a, and diagram's native form, v n.

Minimal complete definition

vectorLike

Methods

vectorLike :: Iso' (v n) a Source #

Isomorphism from Point v n to something PointLike a.

>>> V2 3 5 ^. vectorLike :: (Int, Int)
(3,5)

unvectorLike :: Iso' a (v n) Source #

Isomorphism from something PointLike a to Point v n.

>>> ((3, 5) :: (Int, Int)) ^. unvectorLike
V2 3 5

Instances

Instances details
VectorLike V2 n (Complex n) Source # 
Instance details

Defined in Diagrams.Coordinates.Isomorphic

VectorLike V2 n (V2 n) Source # 
Instance details

Defined in Diagrams.Coordinates.Isomorphic

Methods

vectorLike :: Iso' (V2 n) (V2 n) Source #

unvectorLike :: Iso' (V2 n) (V2 n) Source #

VectorLike V3 n (V3 n) Source # 
Instance details

Defined in Diagrams.Coordinates.Isomorphic

Methods

vectorLike :: Iso' (V3 n) (V3 n) Source #

unvectorLike :: Iso' (V3 n) (V3 n) Source #

n ~ m => VectorLike V2 n (n, m) Source # 
Instance details

Defined in Diagrams.Coordinates.Isomorphic

Methods

vectorLike :: Iso' (V2 n) (n, m) Source #

unvectorLike :: Iso' (n, m) (V2 n) Source #

(n ~ m, m ~ o) => VectorLike V3 n (n, m, o) Source # 
Instance details

Defined in Diagrams.Coordinates.Isomorphic

Methods

vectorLike :: Iso' (V3 n) (n, m, o) Source #

unvectorLike :: Iso' (n, m, o) (V3 n) Source #

Point like

class (Euclidean v, Typeable v) => PointLike v n a | a -> v n where Source #

Provides an Iso' between a and Point v n. This is normally used to convert between the data type you're already using, a, and diagram's native form, Point v n.

Minimal complete definition

pointLike

Methods

pointLike :: Iso' (Point v n) a Source #

Isomorphism from Point v n to something PointLike a.

>>> mkP2 3 5 ^. pointLike :: (Int, Int)
(3,5)

unpointLike :: Iso' a (Point v n) Source #

Isomorphism from something PointLike a to Point v n.

>>> ((3, 5) :: (Int, Int)) ^. unpointLike
P (V2 3 5)

Instances

Instances details
PointLike V2 n (Complex n) Source # 
Instance details

Defined in Diagrams.Coordinates.Isomorphic

PointLike V2 n (V2 n) Source # 
Instance details

Defined in Diagrams.Coordinates.Isomorphic

Methods

pointLike :: Iso' (Point V2 n) (V2 n) Source #

unpointLike :: Iso' (V2 n) (Point V2 n) Source #

RealFloat n => PointLike V2 n (Polar n) Source #

Does not satify lens laws.

Instance details

Defined in Diagrams.Coordinates.Polar

n ~ m => PointLike V2 n (n, m) Source # 
Instance details

Defined in Diagrams.Coordinates.Isomorphic

Methods

pointLike :: Iso' (Point V2 n) (n, m) Source #

unpointLike :: Iso' (n, m) (Point V2 n) Source #

(Euclidean v, Typeable v) => PointLike v n (Point v n) Source # 
Instance details

Defined in Diagrams.Coordinates.Isomorphic

Methods

pointLike :: Iso' (Point v n) (Point v n) Source #

unpointLike :: Iso' (Point v n) (Point v n) Source #

(n ~ m, m ~ o) => PointLike V3 n (n, m, o) Source # 
Instance details

Defined in Diagrams.Coordinates.Isomorphic

Methods

pointLike :: Iso' (Point V3 n) (n, m, o) Source #

unpointLike :: Iso' (n, m, o) (Point V3 n) Source #

type P2Like = PointLike V2 Source #

Things that are isomorphic to points in R2.