diagrams-contrib-1.0.0.1: Collection of user contributions to diagrams EDSL

Maintainer Michael Sloan None

Diagrams.Lens

Description

This module provides utilities for using Control.Lens with diagrams, including orphan instances for the Wrapped class.

Synopsis

# Documentation

type Wrapped' s a = Wrapped s s a aSource

_P :: Iso s t (Point s) (Point t)Source

# Diagrams.Align

_envelopeVMove :: (Monoid a, HasOrigin a, Enveloped a, Num (Scalar (V a))) => V a -> Traversal' a (V a)Source

A singleton Traversal for an envelope vector, where modification of the vector moves the origin appropriately. No vector is traversed when the envelope is empty.

This is the same as _alignedVMove with 1 as the interpolation parameter.

_alignedVMove :: (Monoid a, HasOrigin a, Enveloped a, Num (Scalar (V a))) => V a -> Scalar (V a) -> Traversal' a (V a)Source

A singleton Traversal for an alignment vector, where modification of the vector moves the origin appropriately. No vector is traversed when the envelope is empty.

The interface mimics Diagrams.Align.alignBy in that the d parameter specifies an interpolation between two extremes of the envelope. d = 1 is on the envelope along the vector, whereas d = -1 is on the envelope, away from the vector.

If you need a Point instead of a vector, then compose with _P.

# Diagrams.BoundingBox

_corners :: (HasBasis v, Ord (Basis v), AdditiveGroup (Scalar v), Ord (Scalar v), HasBasis v', Ord (Basis v'), AdditiveGroup (Scalar v'), Ord (Scalar v')) => Traversal (BoundingBox v) (BoundingBox v') (Point v) (Point v')Source

A traversal that either has 0 (empty box) or 2 points. These points are the lower and upper corners, respectively.

_boxExtents :: (HasBasis v, Ord (Basis v), AdditiveGroup (Scalar v), Ord (Scalar v)) => Lens' (BoundingBox v) vSource

A lens that gets the extents of the box. In order to change the extents, this modifies the upper corner.

# Diagrams.Located

_Loc :: Iso (Located a) (Located a') (Point (V a), a) (Point (V a'), a')Source

# Diagrams.Segment

Prism that constructs linear segments. Can also destruct them, if the segment is Linear.

_bezier3 :: Prism' (Segment Closed v) (v, v, v)Source

Prism that constructs cubic bezier segments. Can also destruct them, if segment is a Cubic.

# Diagrams.TwoD.Types

_toTurn :: (Angle a, Angle a') => Iso a a' Turn TurnSource

toTurn is an isomorphism from angles to Turns.