puzzle-draw-0.3.0.0: Creating graphics for pencil puzzles.

Safe HaskellNone
LanguageHaskell98

Data.Compose

Contents

Description

Helpers to string together parser and renderer by puzzle type.

Synopsis

Documentation

type PuzzleHandler b a = forall p q. ParsePuzzle p q -> Drawers b p q -> a Source #

A function to compose an arbitrary matching pair of parser and renderer. In PuzzleHandler b a, b is the rendering backend type, while a is the result type of the composition.

handle :: Backend' b => PuzzleHandler b a -> PuzzleType -> a Source #

handle h t composes the parser and renderer for the puzzle type t with the handler h.

Handlers

drawPuzzleMaybeSol :: PuzzleHandler b ((Value, Maybe Value) -> Parser (Diagram b, Maybe (Diagram b))) Source #

Handler that parses puzzle and an optional solution from a pair of corresponding YAML values, and renders both individually, optionally for the solution.