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

PortabilityGHC
Stabilityhighly unstable
Maintainerstephen.tetley@gmail.com
Safe HaskellSafe-Infered

Wumpus.Basic.Kernel.Drawing.LocDrawing

Contents

Description

Drawing monad with immutable start point.

Synopsis

GenLocDrawing monad

data GenLocDrawing st u a Source

GenLocDrawing is a reader-writer-state monad, unlike GenLocTrace there is no updateable current point, instead the start point is supplied when the drawing is run and it is translated by the components of the start point.

The writer accumulates a graphical trace.

Essentially, GenLocDrawing is an Image object extended with user state.

class Monad m => LocDrawM m whereSource

Methods

inserti :: u ~ DUnit (m ()) => Image u a -> m aSource

inserti_ :: u ~ DUnit (m ()) => Image u a -> m ()Source

insertli :: u ~ DUnit (m ()) => Anchor u -> LocImage u a -> m aSource

insertli_ :: u ~ DUnit (m ()) => Anchor u -> LocImage u a -> m ()Source

insertci :: u ~ DUnit (m ()) => Anchor u -> Anchor u -> ConnectorImage u a -> m aSource

insertci_ :: u ~ DUnit (m ()) => Anchor u -> Anchor u -> ConnectorImage u a -> m ()Source

Instances

runGenLocDrawing :: (Translate a, InterpretUnit u, u ~ DUnit a) => st -> GenLocDrawing st u a -> LocImage u (a, st)Source

evalGenLocDrawing :: (Translate a, InterpretUnit u, u ~ DUnit a) => st -> GenLocDrawing st u a -> LocImage u aSource

Forget the user state LocImage, just return the answer.

execGenLocDrawing :: (Translate a, InterpretUnit u, u ~ DUnit a) => st -> GenLocDrawing st u a -> LocImage u stSource

Forget the answer, just return the user state.

stripGenLocDrawing :: (Translate a, InterpretUnit u, u ~ DUnit a) => st -> GenLocDrawing st u a -> LocQuery u (a, st)Source

runLocDrawing :: (Translate a, InterpretUnit u, u ~ DUnit a) => LocDrawing u a -> LocImage u aSource

Simple version of runGenLocDrawing - run a LocDrawing without user state.