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

PortabilityGHC
Stabilityhighly unstable
Maintainerstephen.tetley@gmail.com

Wumpus.Basic.Kernel.Objects.Basis

Description

Common types and operations.

Synopsis

Documentation

type LocQuery u a = CF (Point2 u -> a)Source

type LocThetaQuery u a = CF (Point2 u -> Radian -> a)Source

type ConnectorQuery u a = CF (Point2 u -> Point2 u -> a)Source

data ImageAns u a Source

Constructors

Ans CatPrim a 

Instances

Monoid a => Monoid (ImageAns u a) 
Rotate a => Rotate (ImageAns u a) 
(u ~ DUnit a, RotateAbout a, ScalarUnit u) => RotateAbout (ImageAns u a) 
Scale a => Scale (ImageAns u a) 
(u ~ DUnit a, Translate a, ScalarUnit u) => Translate (ImageAns u a) 
OPlus a => OPlus (ImageAns u a) 

mapAns :: (a -> a1) -> ImageAns u a -> ImageAns u a1Source

Map the answer produced by a graphic object.

Note - the new answer must share the same unit type as the initial answer, although it does not need to have the same wrapper type.

replaceAns :: ans -> ImageAns u a -> ImageAns u ansSource

Replace the answer produced by a graphic object.

Note - the new answer must share the same unit type as the initial answer, although it does not need to have the same wrapper type.

ignoreAns :: ImageAns u a -> GraphicAns uSource

Turn an imageAns into a GraphicAns by ignoring the result.

Usually this function will be used with one of the push family of combinators.

 LocImage-to-LocGraphic = pushR1 ignoreAns 

answer :: ImageAns u a -> aSource

Extractor for the answer part of an image.

hyperlink :: XLink -> ImageAns u a -> ImageAns u aSource

Note - maybe this requires an arity family instead?

clipObject :: PrimPath -> ImageAns t u -> ImageAns t uSource

Clip a graphic object.

Note - maybe this requires an arity family instead?

at :: LocQuery u a -> Point2 u -> CF aSource

Downcast a LocCF function by applying it to the supplied point, making an arity-zero Context Function.

Remember a LocCF function is a CF1 context function where the static argument is specialized to a start point.

incline :: LocThetaQuery u a -> Radian -> LocQuery u aSource

Downcast a LocThetaQuery function by applying it to the supplied angle, making an arity-one Context Function (a LocCF).

atIncline :: LocThetaQuery u a -> Point2 u -> Radian -> CF aSource

Downcast a LocThetaQuery function by applying it to the supplied point and angle, making an arity-zero Context Function (a CF).

connect :: ConnectorQuery u a -> Point2 u -> Point2 u -> CF aSource

Downcast a ConnectorQuery function by applying it to the start and end point, making an arity-zero Context Function (a CF).

replaceAnsR0 :: ans -> CF (ImageAns u a) -> CF (ImageAns u ans)Source

Replace the ans - arity 0.

replaceAnsR1 :: ans -> CF (r1 -> ImageAns u a) -> CF (r1 -> ImageAns u ans)Source

Replace the ans - arity 1.

replaceAnsR2 :: ans -> CF (r1 -> r2 -> ImageAns u a) -> CF (r1 -> r2 -> ImageAns u ans)Source

Replace the ans - arity 2.

decorateR0 :: CF (ImageAns u a) -> CF (GraphicAns u) -> CF (ImageAns u a)Source

Decorate an Image by superimposing a Graphic.

Note - this function has a very general type signature and supports various graphic types:

decorateR1 :: CF (r1 -> ImageAns u a) -> CF (r1 -> GraphicAns u) -> CF (r1 -> ImageAns u a)Source

decorateR2 :: CF (r1 -> r2 -> ImageAns u a) -> CF (r1 -> r2 -> GraphicAns u) -> CF (r1 -> r2 -> ImageAns u a)Source

elaborateR0 :: CF (ImageAns u a) -> (a -> CF (GraphicAns u)) -> CF (ImageAns u a)Source

Decorate an Image by superimposing a Graphic.

Note - this function has a very general type signature and supports various graphic types:

elaborateR1 :: CF (r1 -> ImageAns u a) -> (a -> CF (r1 -> GraphicAns u)) -> CF (r1 -> ImageAns u a)Source

Decorate an Image by superimposing a Graphic.

Note - this function has a very general type signature and supports various graphic types:

elaborateR2 :: CF (r1 -> r2 -> ImageAns u a) -> (a -> CF (r1 -> r2 -> GraphicAns u)) -> CF (r1 -> r2 -> ImageAns u a)Source