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
Note - this needs DrawingContext as an explicit parameter,
and hence it returns a pair of
(a, HPrim u) rather than an
It is expected this will be wrapped in to form a specific TraceDrawing draw function for the amalgamated monad.