wumpus-basic-0.22.0: Basic objects and system code built on Wumpus-Core.

PortabilityGHC
Stabilityhighly unstable
Maintainerstephen.tetley@gmail.com

Wumpus.Basic.Kernel.Base.BaseDefs

Contents

Description

The elementary base types and classes.

Synopsis

Constants

Unit phantom type

data UNil u Source

The empty data type - i.e. () - wrapped with a phantom unit parameter.

Constructors

UNil 

Instances

Functor UNil 
Eq (UNil u) 
Ord (UNil u) 
Read (UNil u) 
Show (UNil u) 
Monoid (UNil u) 
Rotate (UNil u) 
RotateAbout (UNil u) 
Scale (UNil u) 
Translate (UNil u) 

ureturn :: Monad m => m (UNil u)Source

Return a UNil rather than () at the end of sequence of monadic commands.

Many Wumpus objects are usefully constructed in the do-notation, but because Wumpus has to expose the type of the unit to the type checker we must finish the do-block with:

 ureturn

or:

 return UNil

rather than:

 return ()

uvoid :: Monad m => m a -> m (UNil u)Source

uvoid runs a monadic computation and returns UNil.

Non-contextual unit conversion.

Unit interpretation with respect to the current Point size

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.

intraMapFunctor :: (Functor f, InterpretUnit u) => FontSize -> (f Double -> f Double) -> f u -> f uSource

KernChar

type KernChar u = (u, EscapedChar)Source

Unit parametric version of KerningChar from Wumpus-Core.

Drawing paths and shapes (closed paths)

data PathMode Source

Draw closed paths.

 OSTROKE - open and stroked

data DrawMode Source

Draw closed paths and shapes.

 DRAW_STROKE - closed and stroked
 DRAW_FILL - closed and filled
 CLOSED_FILL_STROKE - the path is filled, its edge is stroked.

closedMode :: DrawMode -> PathModeSource

Interpret a DrawMode for a closed path.

Drawing layers

data ZDeco Source

Decorating with resepct to the Z-order

 SUPERIOR - in front. 
 ANTERIOR - behind.

Constructors

SUPERIOR 
ANTERIOR 

Alignment

data HAlign Source

Horizontal alignment - align to the top, center or bottom.

data VAlign Source

Vertical alignment - align to the left, center or bottom.

Text height

data TextHeight Source

Wumpus distinguishes two use-cases for displaying vertically centered text.

Arbitrary text that is expected to contain lower case letters with descenders, show take the vertical center as the mid-point between the cap height and the descender depth.

Unfortunately, including the descender depth can produce unbalanced results for text which is not expected to have descenders (e.g. numbers within a bordered box), visually this makes the center too high.

Cardinal (compass) positions

data Cardinal Source

An enumeratied type representing the compass positions.

Direction enumeration

data Direction Source

An enumerated type representing horizontal and vertical directions.

Constructors

UP 
DOWN 
LEFT 
RIGHT 

data ClockDirection Source

An enumerated type representing clock directions.

Constructors

CW 
CCW 

Misc

both :: Applicative f => f a -> f b -> f (a, b)Source

Applicative both - run both computations return the pair of the the answers.

monPreRepeatPost :: Monoid a => a -> (Int, a) -> a -> aSource

Monodial scheme - prefix, repeat body n times, suffix.