Portability | GHC |
---|---|
Stability | highly unstable |
Maintainer | stephen.tetley@gmail.com |
The elementary base types and classes.
- type family MonUnit m :: *
- class OPlus t where
- oplus :: t -> t -> t
- oconcat :: OPlus t => t -> [t] -> t
- altconcat :: OPlus a => a -> [a] -> a
- class Bimap f where
- replaceL :: Bimap f => p -> f a b -> f p b
- replaceR :: Bimap f => q -> f a b -> f a q
- data UNil u = UNil
- class ScalarUnit a where
- fromPsPoint :: Double -> a
- toPsPoint :: a -> Double
- class Num u => InterpretUnit u where
- dinterpF :: (Functor t, InterpretUnit u) => FontSize -> t Double -> t u
- normalizeF :: (Functor t, InterpretUnit u) => FontSize -> t u -> t Double
- uconvert1 :: (InterpretUnit u, InterpretUnit u1) => FontSize -> u -> u1
- uconvertF :: (Functor t, InterpretUnit u, InterpretUnit u1) => FontSize -> t u -> t u1
- intraMapPoint :: InterpretUnit u => FontSize -> (DPoint2 -> DPoint2) -> Point2 u -> Point2 u
- intraMapFunctor :: (Functor f, InterpretUnit u) => FontSize -> (f Double -> f Double) -> f u -> f u
- data HAlign
- data VAlign
- data Cardinal
- = NORTH
- | NORTH_EAST
- | EAST
- | SOUTH_EAST
- | SOUTH
- | SOUTH_WEST
- | WEST
- | NORTH_WEST
- type AdvanceVec u = Vec2 u
- advanceH :: AdvanceVec u -> u
- advanceV :: AdvanceVec u -> u
Documentation
type family MonUnit m :: *Source
Type family to access the unit parameter of a TraceDrawing or a promoted TraceDrawingT transformer.
A semigroup class
A Semigroup class.
The perhaps unusual name is the TeX name for the circled plus glyph. It would be nice if there was a semigroup class in the Haskell Base libraries...
OPlus () | |
OPlus Primitive | |
OPlus CatPrim | |
OPlus CtxPicture | a `oplus` b Place 'drawing' a over b. The idea of |
Ord u => OPlus (BoundingBox u) | |
Num u => OPlus (Vec2 u) | |
OPlus (UNil u) | |
OPlus a => OPlus (CF a) | |
(Fractional u, Ord u) => OPlus (Orientation u) | |
(Fractional u, Ord u) => OPlus (PosObject u) | |
OPlus a => OPlus (r -> a) | |
(OPlus a, OPlus b) => OPlus (a, b) | |
OPlus a => OPlus (Const a b) | |
OPlus a => OPlus (ImageAns u a) | |
(OPlus a, OPlus b, OPlus c) => OPlus (a, b, c) | |
(OPlus a, OPlus b, OPlus c, OPlus d) => OPlus (a, b, c, d) |
oconcat :: OPlus t => t -> [t] -> tSource
oconcat
: list_head * [rest] -> Ans
Semigroup version of mconcat
from the module Data.Monoid
.
As a semigroup cannot build a zero value, concat cannot
handle the empty list. So to make oconcat
a safe function
the input list is already destructured by one cons cell.
Effectively this means that client code must handle the
empty list case, before calling oconcat
.
altconcat :: OPlus a => a -> [a] -> aSource
altconcat
: alternative * [list] -> Ans
altconcat
uses oplus
to create a summary value from a list
of values.
When supplied the empty list altconcat
returns the supplied
alternative value. If the list is inhabited, the alternative
value is discarded.
This contrasts to oconcat
where the single value represents
the head of an already destructured list.
A bifunctor class
A Bifunctor class.
Again, it would be nice if there was a Bifunctor class in the Haskell Base libraries...
Unit phantom type
The empty data type - i.e. ()
- wrapped with a phantom unit
parameter.
Non-contextual unit conversion.
class ScalarUnit a whereSource
Unit interpretation with respect to the current Point size
class Num u => InterpretUnit u whereSource
dinterpF :: (Functor t, InterpretUnit u) => FontSize -> t Double -> t uSource
dinterp
an object that gives access to its unit at the
functor position.
normalizeF :: (Functor t, InterpretUnit u) => FontSize -> t u -> t DoubleSource
normalize
an object that gives access to its unit at the
functor position.
uconvert1 :: (InterpretUnit u, InterpretUnit u1) => FontSize -> u -> u1Source
Convert a scalar value from one unit to another.
uconvertF :: (Functor t, InterpretUnit u, InterpretUnit u1) => FontSize -> t u -> t u1Source
Unit convert an object that gives access to its unit at the Functor position.
In practive this will be *all* Image answers.
intraMapPoint :: InterpretUnit u => FontSize -> (DPoint2 -> DPoint2) -> Point2 u -> Point2 uSource
intraMapFunctor :: (Functor f, InterpretUnit u) => FontSize -> (f Double -> f Double) -> f u -> f uSource
Alignment
Horizontal alignment - align to the top, center or bottom.
Vertical alignment - align to the left, center or bottom.
Cardinal (compass) positions
An enumeratied type representing the compass positions.
Advance vector
type AdvanceVec u = Vec2 uSource
Advance vectors provide an idiom for drawing consecutive graphics. PostScript uses them to draw left-to-right text - each character has an advance vector for the width and as characters are drawn they successively displace the start point for the next character with their advance vector.
Type alias for Vec2.
advanceH :: AdvanceVec u -> uSource
Extract the horizontal component of an advance vector.
For left-to-right latin text, the vertical component of an advance vector is expected to be 0. Ingoring it seems permissible when drawing text.
advanceV :: AdvanceVec u -> uSource
Extract the verticall component of an advance vector.