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.Basis

Description

User state class for Drawing monads.

Synopsis

Documentation

type family UState m :: *Source

class (Applicative m, Monad m) => UserStateM m whereSource

Methods

getState :: st ~ UState (m a) => m stSource

setState :: st ~ UState (m a) => st -> m ()Source

updateState :: st ~ UState (m a) => (st -> st) -> m ()Source

class InsertlM m whereSource

Monad that collects a graphic trace, insertl is analogue to the Writer monad's tell.

Methods

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

insertl_ :: u ~ DUnit (m ()) => LocImage u a -> m (UNil u)Source

Instances

class Monad m => LocationM m whereSource

Monad with notion of location - i.e. the current point.

Methods

location :: u ~ DUnit (m ()) => m (Point2 u)Source

class LocationM m => CursorM m whereSource

Monad with turtle-like cursor movememnt.

Methods

moveby :: u ~ DUnit (m ()) => Vec2 u -> m ()Source

Instances

class CursorM m => BranchCursorM m whereSource

Add operations for branching at the current point.

Not all drawings that support tracing support branching. For instance Paths can be built by tracing but they always need a cumulative progression of next point they cannot resrt to the start point and go in a differnt direction.

Methods

branchCursor :: m a -> m aSource

Branch is like local in the Reader monad.

Instances

hmoveby :: (CursorM m, Num u, u ~ DUnit (m ())) => u -> m ()Source

Move the cursor horizontally.

vmoveby :: (CursorM m, Num u, u ~ DUnit (m ())) => u -> m ()Source

Move the cursor vertically.