diagrams-core-1.5.1.1: Core libraries for diagrams EDSL

Safe Haskell | None
Language | Haskell2010

Diagrams.Core.Measure

Synopsis

- newtype Measured n a = Measured {
  - unmeasure :: (n, n, n) -> a
  }
- type Measure n = Measured n n
- fromMeasured :: Num n => n -> n -> Measured n a -> a
- output :: n -> Measure n
- local :: Num n => n -> Measure n
- global :: Num n => n -> Measure n
- normalized :: Num n => n -> Measure n
- normalised :: Num n => n -> Measure n
- scaleLocal :: Num n => n -> Measured n a -> Measured n a
- atLeast :: Ord n => Measure n -> Measure n -> Measure n
- atMost :: Ord n => Measure n -> Measure n -> Measure n

# Documentation

newtype Measured n a Source #

'Measured n a' is an object that depends on `local`, `normalized` and `global` scales. The `normalized` and `global` scales are calculated when rendering a diagram.

For attributes, the `local` scale gets multiplied by the average scale of the transform.

Constructors

Measured |

Fields

- unmeasure :: (n, n, n) -> a

#### Instances

Instances details

Profunctor Measured Source # |

Instance details

Defined in Diagrams.Core.Measure

Methods

dimap :: (a -> b) -> (c -> d) -> Measured b c -> Measured a d Source #

lmap :: (a -> b) -> Measured b c -> Measured a c Source #

rmap :: (b -> c) -> Measured a b -> Measured a c Source #

(#.) :: forall a b c q. Coercible c b => q b c -> Measured a b -> Measured a c Source #

(.#) :: forall a b c q. Coercible b a => Measured b c -> q a b -> Measured a c Source #

Representable (Measured n) Source # |

Instance details

Defined in Diagrams.Core.Measure

Associated Types

type Rep (Measured n) |
Instance details Defined in Diagrams.Core.Measure type Rep (Measured n) = (n, n, n)

Methods

tabulate :: (Rep (Measured n) -> a) -> Measured n a Source #

index :: Measured n a -> Rep (Measured n) -> a Source #

Distributive (Measured n) Source # |
Instance details Defined in Diagrams.Core.Measure Methods distribute :: Functor f => f (Measured n a) -> Measured n (f a) Source # collect :: Functor f => (a -> Measured n b) -> f a -> Measured n (f b) Source # distributeM :: Monad m => m (Measured n a) -> Measured n (m a) Source # collectM :: Monad m => (a -> Measured n b) -> m a -> Measured n (m b) Source #
Applicative (Measured n) Source # |
Instance details Defined in Diagrams.Core.Measure Methods pure :: a -> Measured n a Source # (<*>) :: Measured n (a -> b) -> Measured n a -> Measured n b Source # liftA2 :: (a -> b -> c) -> Measured n a -> Measured n b -> Measured n c Source # (*>) :: Measured n a -> Measured n b -> Measured n b Source # (<*) :: Measured n a -> Measured n b -> Measured n a Source #
Functor (Measured n) Source # |
Instance details Defined in Diagrams.Core.Measure Methods fmap :: (a -> b) -> Measured n a -> Measured n b Source # (<$) :: a -> Measured n b -> Measured n a Source #
Monad (Measured n) Source # |
Instance details Defined in Diagrams.Core.Measure Methods (>>=) :: Measured n a -> (a -> Measured n b) -> Measured n b Source # (>>) :: Measured n a -> Measured n b -> Measured n b Source # return :: a -> Measured n a Source #
Additive (Measured n) Source # |

Instance details

Defined in Diagrams.Core.Measure

Methods

zero :: Num a => Measured n a Source #

(^+^) :: Num a => Measured n a -> Measured n a -> Measured n a Source #

(^-^) :: Num a => Measured n a -> Measured n a -> Measured n a Source #

lerp :: Num a => a -> Measured n a -> Measured n a -> Measured n a Source #

liftU2 :: (a -> a -> a) -> Measured n a -> Measured n a -> Measured n a Source #

liftI2 :: (a -> b -> c) -> Measured n a -> Measured n b -> Measured n c Source #

HasOrigin t => HasOrigin (Measured n t) Source # |
Instance details Defined in Diagrams.Core.HasOrigin Methods moveOriginTo :: Point (V (Measured n t)) (N (Measured n t)) -> Measured n t -> Measured n t Source #
Juxtaposable a => Juxtaposable (Measured n a) Source # |
Instance details Defined in Diagrams.Core.Juxtapose Methods juxtapose :: Vn (Measured n a) -> Measured n a -> Measured n a -> Measured n a Source #
Qualifiable a => Qualifiable (Measured n a) Source # |
Instance details Defined in Diagrams.Core.Names Methods (.>>) :: IsName a0 => a0 -> Measured n a -> Measured n a Source #
HasStyle b => HasStyle (Measured n b) Source # |
Instance details Defined in Diagrams.Core.Style Methods applyStyle :: Style (V (Measured n b)) (N (Measured n b)) -> Measured n b -> Measured n b Source #
(InSpace v n t, Transformable t, HasLinearMap v, Floating n) => Transformable (Measured n t) Source # |
Instance details Defined in Diagrams.Core.Transform Methods transform :: Transformation (V (Measured n t)) (N (Measured n t)) -> Measured n t -> Measured n t Source #
Monoid a => Monoid (Measured n a) Source # |
Instance details Defined in Diagrams.Core.Measure Methods mempty :: Measured n a Source # mappend :: Measured n a -> Measured n a -> Measured n a Source # mconcat :: [Measured n a] -> Measured n a Source #
Semigroup a => Semigroup (Measured n a) Source # |
Instance details Defined in Diagrams.Core.Measure Methods (<>) :: Measured n a -> Measured n a -> Measured n a Source # sconcat :: NonEmpty (Measured n a) -> Measured n a Source # stimes :: Integral b => b -> Measured n a -> Measured n a Source #
Floating a => Floating (Measured n a) Source # |

Instance details

Defined in Diagrams.Core.Measure

Methods

pi :: Measured n a Source #

exp :: Measured n a -> Measured n a Source #

log :: Measured n a -> Measured n a Source #

sqrt :: Measured n a -> Measured n a Source #

(**) :: Measured n a -> Measured n a -> Measured n a Source #

logBase :: Measured n a -> Measured n a -> Measured n a Source #

sin :: Measured n a -> Measured n a Source #

cos :: Measured n a -> Measured n a Source #

tan :: Measured n a -> Measured n a Source #

asin :: Measured n a -> Measured n a Source #

acos :: Measured n a -> Measured n a Source #

atan :: Measured n a -> Measured n a Source #

sinh :: Measured n a -> Measured n a Source #

cosh :: Measured n a -> Measured n a Source #

tanh :: Measured n a -> Measured n a Source #

asinh :: Measured n a -> Measured n a Source #

acosh :: Measured n a -> Measured n a Source #

atanh :: Measured n a -> Measured n a Source #

log1p :: Measured n a -> Measured n a Source #

expm1 :: Measured n a -> Measured n a Source #

log1pexp :: Measured n a -> Measured n a Source #

log1mexp :: Measured n a -> Measured n a Source #

Num a => Num (Measured n a) Source # |

Instance details

Defined in Diagrams.Core.Measure

Methods

(+) :: Measured n a -> Measured n a -> Measured n a Source #

(-) :: Measured n a -> Measured n a -> Measured n a Source #

(*) :: Measured n a -> Measured n a -> Measured n a Source #

negate :: Measured n a -> Measured n a Source #

abs :: Measured n a -> Measured n a Source #

signum :: Measured n a -> Measured n a Source #

fromInteger :: Integer -> Measured n a Source #

Fractional a => Fractional (Measured n a) Source # |
Instance details Defined in Diagrams.Core.Measure Methods (/) :: Measured n a -> Measured n a -> Measured n a Source # recip :: Measured n a -> Measured n a Source # fromRational :: Rational -> Measured n a Source #
MonadReader (n, n, n) (Measured n) Source # |
Instance details Defined in Diagrams.Core.Measure Methods ask :: Measured n (n, n, n) Source # local :: ((n, n, n) -> (n, n, n)) -> Measured n a -> Measured n a Source # reader :: ((n, n, n) -> a) -> Measured n a Source #
type Rep (Measured n) Source # |
Instance details Defined in Diagrams.Core.Measure type Rep (Measured n) = (n, n, n)
type N (Measured n a) Source # |
Instance details Defined in Diagrams.Core.Measure type N (Measured n a) = N a
type V (Measured n a) Source # |
Instance details Defined in Diagrams.Core.Measure type V (Measured n a) = V a

type Measure n = Measured n n Source #

A measure is a `Measured` number.

fromMeasured :: Num n => n -> n -> Measured n a -> a Source #

    fromMeasured globalScale normalizedScale measure -> a

output :: n -> Measure n Source #

Output units don't change.

local :: Num n => n -> Measure n Source #

Local units are scaled by the average scale of a transform.

global :: Num n => n -> Measure n Source #

Global units are scaled so that they are interpreted relative to the size of the final rendered diagram.

normalized :: Num n => n -> Measure n Source #

Normalized units get scaled so that one normalized unit is the size of the final diagram.

normalised :: Num n => n -> Measure n Source #

Just like `normalized` but spelt properly.

scaleLocal :: Num n => n -> Measured n a -> Measured n a Source #

Scale the local units of a `Measured` thing.

atLeast :: Ord n => Measure n -> Measure n -> Measure n Source #

Calculate the larger of two measures.

atMost :: Ord n => Measure n -> Measure n -> Measure n Source #

Calculate the smaller of two measures.