Safe Haskell | Safe-Inferred |
---|
Common definitions for a renderer that supports failure.
Documentation
type Render = WriterT String (Except String)Source
A monad for accumulating string output with the possibility of failure.
runRender :: Render a -> Either String StringSource
Returns either the rendered result on the right, or a message describing a failure on the left.
rendererOf :: Show a => String -> (a -> Render ()) -> a -> Render ()Source
Wraps a renderer in an exception handler that, when the renderer or something it calls fails, will add context about this renderer's invocation to the failure message.