goatee-0.2.0: A monadic take on a 2,500-year-old board game - library.
Game.Goatee.Lib.Renderer
Description
Common definitions for a renderer that supports failure.
Synopsis
type Render = WriterT String (Either 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.