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

Stability | unstable |

Maintainer | stephen.tetley@gmail.com |

Base classes and type families.

Drawing is always built on TraceM and DrawingCtxM, it may use PointSupplyM for chains or turtle drawing.

- type family MonUnit m :: *
- class Monad m => TraceM m where
- class Monad m => DrawingCtxM m where
- askCtx :: m DrawingContext
- localCtx :: (DrawingContext -> DrawingContext) -> m a -> m a

- asksCtx :: DrawingCtxM m => (DrawingContext -> a) -> m a
- class Monad m => PointSupplyM m where

# Documentation

class Monad m => TraceM m whereSource

Collect elementary graphics as part of a larger drawing.

TraceM works much like a writer monad.

class Monad m => DrawingCtxM m whereSource

askCtx :: m DrawingContextSource

localCtx :: (DrawingContext -> DrawingContext) -> m a -> m aSource

DrawingCtxM (Drawing u) | |

DrawingCtxM (TurtleDrawing u) | |

(Monad m, DrawingCtxM m) => DrawingCtxM (ChainT u m) | |

Monad m => DrawingCtxM (DrawingT u m) | |

DrawingCtxM m => DrawingCtxM (TurtleT u m) |

asksCtx :: DrawingCtxM m => (DrawingContext -> a) -> m aSource

Project a value out of a context.

class Monad m => PointSupplyM m whereSource

A monad that supplies points, e.g. a turtle monad.

Num u => PointSupplyM (TurtleDrawing u) | |

Monad m => PointSupplyM (ChainT u m) | |

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