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.
- type Coord = (Int, Int)
- class Monad m => TurtleM m where
- setsLoc :: TurtleM m => (Coord -> (a, Coord)) -> m a
- setsLoc_ :: TurtleM m => (Coord -> Coord) -> m ()
- resetLoc :: TurtleM m => m ()
- moveLeft :: TurtleM m => m ()
- moveRight :: TurtleM m => m ()
- moveUp :: TurtleM m => m ()
- moveDown :: TurtleM m => m ()
- nextLine :: TurtleM m => m ()