show-prettyprint-0.2.2: Robust prettyprinter for output of auto-generated Show instances

Safe HaskellNone
LanguageHaskell2010

Text.Show.Prettyprint.Diagnostic

Description

These functions are identical to the ones in the main module, but instead of falling back to the un-prettyprinted input, they will report an error on failure.

>>> putStrLn (prettifyShowErr "Imbalanced (Parenthesis)) here")
ERROR (interactive):1:25: error: expected: char literal,
    end of input, identifier, list,
    number, record, string literal,
    tuple, unit
Imbalanced (Parenthesis)) here<EOF>
                        ^

Synopsis

Documentation

prettifyShowErr :: String -> String Source #

Attempt to prettify a string produced by show. Report error information on failure.

prettyShowErr :: Show a => a -> String Source #

prettifyShowErr with the show baked in.

prettyPrintErr :: Show a => a -> IO () Source #

prettifyShowErr with the show and the putStrLn baked in.