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

Stability | unstable |

Maintainer | stephen.tetley@gmail.com |

Build multi-part Graphics with an accumulator (i.e. a Writer monad).

Note - the run functions for the transformer and the plain monad are quite different. This is mandated by the need to single-thread the DrawingContext through the transformer.

- data TraceGraphic u a
- data TraceGraphicT u m a
- class Monad m => TraceGraphicM m where
- runTraceGraphic :: TraceGraphic u a -> Image u a
- runTraceGraphicT :: Monad m => DrawingContext -> TraceGraphicT u m a -> m (a, HPrim u)
- liftTraceGraphicT :: Monad m => m a -> TraceGraphicT u m a

# Documentation

data TraceGraphic u a Source

Monad (TraceGraphic u) | |

Functor (TraceGraphic u) | |

Applicative (TraceGraphic u) | |

DrawingCtxM (TraceGraphic u) | |

TraceGraphicM (TraceGraphic u) |

data TraceGraphicT u m a Source

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

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

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

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

Monad m => TraceGraphicM (TraceGraphicT u m) |

class Monad m => TraceGraphicM m whereSource

TraceGraphicM (TraceGraphic u) | |

Monad m => TraceGraphicM (TraceGraphicT u m) |

runTraceGraphic :: TraceGraphic u a -> Image u aSource

runTraceGraphicT :: Monad m => DrawingContext -> TraceGraphicT u m a -> m (a, HPrim u)Source

Note - this needs DrawingContext as an explicit parameter,
and hence it returns a pair of `(a, HPrim u)`

rather than an
Image.

It is expected this will be wrapped in to form a specific
TraceDrawing *draw* function for the amalgamated monad.

liftTraceGraphicT :: Monad m => m a -> TraceGraphicT u m aSource