generic-diff
Safe HaskellSafe-Inferred
LanguageHaskell2010

Generics.Diff.Render

Description

The types in Diff have derived Show instances that don't help at all in one of the goals for the library, which is readability. This module lets us render those types in a friendly way.

Synopsis

Rendering

renderDiffResultWith :: RenderOpts -> DiffResult a -> Builder Source #

Render a DiffResult using a lazy Builder, using custom RenderOpts.

Printing

printDiffResult :: DiffResult a -> IO () Source #

Print a DiffResult to the terminal.

printDiffResultWith :: RenderOpts -> DiffResult a -> IO () Source #

Print a DiffResult to the terminal, using custom RenderOpts.

Options

data RenderOpts Source #

Configuration type used to tweak the output of renderDiffResultWith.

Use defaultRenderOpts and the field accessors below to construct.

Instances

Instances details
Show RenderOpts Source # 
Instance details

Defined in Generics.Diff.Render

defaultRenderOpts :: RenderOpts Source #

Sensible rendering defaults. No numbers, 2-space indentation.

indentSize :: RenderOpts -> Natural Source #

How many spaces to indent each new "level" of comparison.

numberedLevels :: RenderOpts -> Bool Source #

Whether or not to include level numbers in the output.

Helper rendering functions

renderDiffError :: DiffError a -> Builder Source #

Render a DiffError using a lazy Builder.

renderDiffErrorWith :: RenderOpts -> DiffError a -> Builder Source #

Render a DiffError using a lazy Builder, using custom RenderOpts.