Portability | GHC |
---|---|
Stability | unstable |
Maintainer | stephen.tetley@gmail.com |
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.
- type Coord = (Int, Int)
- data TurtleConfig u = TurtleConfig {}
- regularConfig :: u -> TurtleConfig u
- class Monad m => TurtleM m where
- class TurtleM m => TurtleScaleM m u | m -> u where
- askSteps :: TurtleScaleM m u => m (u, u)
- 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 ()
- getPos :: (TurtleScaleM m u, Num u) => m (Point2 u)
- scaleCoord :: (TurtleScaleM m u, Num u) => (Int, Int) -> m (Point2 u)
Documentation
regularConfig :: u -> TurtleConfig uSource
class Monad m => TurtleM m whereSource
TurtleM (TurtleDrawing u) | |
Monad m => TurtleM (TurtleT u m) |
class TurtleM m => TurtleScaleM m u | m -> u whereSource
TurtleScaleM (TurtleDrawing u) u | |
Monad m => TurtleScaleM (TurtleT u m) u |
askSteps :: TurtleScaleM m u => m (u, u)Source
movement
getPos :: (TurtleScaleM m u, Num u) => m (Point2 u)Source
scaleCoord :: (TurtleScaleM m u, Num u) => (Int, Int) -> m (Point2 u)Source