wumpus-basic-0.8.0: Common drawing utilities built on wumpus-core.

PortabilityGHC
Stabilityunstable
Maintainerstephen.tetley@gmail.com

Wumpus.Basic.Monads.TurtleClass

Contents

Description

Turtle monad and monad transformer.

The Turtle monad embodies the LOGO style of imperative drawing - sending commands to update the a cursor.

While Wumpus generally aims for a more compositional, "coordinate-free" style of drawing, some types of diagram are more easily expressed in the LOGO style.

Synopsis

Documentation

type Coord = (Int, Int)Source

data TurtleConfig u Source

Constructors

TurtleConfig 

Fields

xstep :: !u
 
ystep :: !u
 

Instances

Eq u => Eq (TurtleConfig u) 
Show u => Show (TurtleConfig u) 

class Monad m => TurtleM m whereSource

Methods

getLoc :: m (Int, Int)Source

setLoc :: (Int, Int) -> m ()Source

getOrigin :: m (Int, Int)Source

setOrigin :: (Int, Int) -> m ()Source

Instances

class TurtleM m => TurtleScaleM m u | m -> u whereSource

Methods

xStep :: m uSource

yStep :: m uSource

Instances

askSteps :: TurtleScaleM m u => m (u, u)Source

setsLoc :: TurtleM m => (Coord -> (a, Coord)) -> m aSource

setsLoc_ :: TurtleM m => (Coord -> Coord) -> m ()Source

movement

getPos :: (TurtleScaleM m u, Num u) => m (Point2 u)Source

scaleCoord :: (TurtleScaleM m u, Num u) => (Int, Int) -> m (Point2 u)Source