wumpus-basic-0.13.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.

Note - as turtle drawing with Wumpus is a local effect, there is only one instance of TurtleM. Potentially TurtleM will be removed and the functions implemented directly.

Synopsis

Documentation

type Coord = (Int, Int)Source

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

Monad m => TurtleM (TurtleT u m) 

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

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

movement