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

Stabilityhighly unstable




The elementary base types and classes.



type family MonUnit m :: *Source

Type family to access the unit parameter of a TraceDrawing or a promoted TraceDrawingT transformer.

A semigroup class

class OPlus t whereSource

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 :: t -> t -> tSource


OPlus () 
OPlus Primitive 
OPlus CatPrim 
OPlus CtxPicture
 a `oplus` b

Place 'drawing' a over b. The idea of over here is in terms z-ordering, nither picture a or b are actually moved.

Ord u => OPlus (BoundingBox u) 
Num u => OPlus (Vec2 u) 
OPlus (UNil u) 
(Fractional u, Ord u) => OPlus (Orientation u) 
OPlus a => OPlus (r -> a) 
(OPlus a, OPlus b) => OPlus (a, b) 
OPlus a => OPlus (Const a b) 
(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

class Bimap f whereSource

A Bifunctor class.

Again, it would be nice if there was a Bifunctor class in the Haskell Base libraries...


bimap :: (a -> p) -> (b -> q) -> f a b -> f p qSource

bimapL :: (a -> p) -> f a b -> f p bSource

bimapR :: (b -> q) -> f a b -> f a qSource


replaceL :: Bimap f => p -> f a b -> f p bSource

replaceR :: Bimap f => q -> f a b -> f a qSource

Unit phantom type

data UNil u Source

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




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) 
OPlus (UNil u) 

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

Drawing paths

Drawing layer

data ZDeco Source

Decorating with resepct to the Z-order

 SUPERIOR - in front. 
 ANTERIOR - behind.




data HAlign Source

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



data VAlign Source

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



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.



Misc (potentially for Wumpus-Core)

vsum :: Num u => [Vec2 u] -> Vec2 uSource

Sum a list of Vectors.

Note - this function is a candidate to go in Wumpus-Core, but it will be added when there is an intrinsic reason to to update Core (bug fix, or API change).