Portability | GHC |
---|---|

Stability | unstable |

Maintainer | stephen.tetley@gmail.com |

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

Turtle is only a transformer - it is intended to be run within
a `Drawing`

.

- module Wumpus.Basic.Monads.TurtleClass
- data TurtleT u m a
- runTurtleT :: (Monad m, Num u) => TurtleConfig u -> (Int, Int) -> TurtleT u m a -> m a
- data TurtleDrawing u a
- runTurtleDrawing :: Num u => TurtleConfig u -> (Int, Int) -> DrawingContext -> TurtleDrawing u a -> (a, HPrim u)
- execTurtleDrawing :: Num u => TurtleConfig u -> (Int, Int) -> DrawingContext -> TurtleDrawing u a -> HPrim u

# Re-exports

# Turtle transformer

Monad m => Monad (TurtleT u m) | |

Monad m => Functor (TurtleT u m) | |

Monad m => Applicative (TurtleT u m) | |

Monad m => TurtleM (TurtleT u m) | |

(u ~ MonUnit m, Monad m, Num u) => PointSupplyM (TurtleT u m) | |

DrawingCtxM m => DrawingCtxM (TurtleT u m) | |

(u ~ MonUnit m, Monad m, TraceM m) => TraceM (TurtleT u m) | |

Monad m => TurtleScaleM (TurtleT u m) u |

runTurtleT :: (Monad m, Num u) => TurtleConfig u -> (Int, Int) -> TurtleT u m a -> m aSource

# Turtle combined with Drawing

data TurtleDrawing u a Source

Monad (TurtleDrawing u) | |

Functor (TurtleDrawing u) | |

Applicative (TurtleDrawing u) | |

TurtleM (TurtleDrawing u) | |

Num u => PointSupplyM (TurtleDrawing u) | |

DrawingCtxM (TurtleDrawing u) | |

TraceM (TurtleDrawing u) | |

TurtleScaleM (TurtleDrawing u) u |

runTurtleDrawing :: Num u => TurtleConfig u -> (Int, Int) -> DrawingContext -> TurtleDrawing u a -> (a, HPrim u)Source

execTurtleDrawing :: Num u => TurtleConfig u -> (Int, Int) -> DrawingContext -> TurtleDrawing u a -> HPrim uSource