wl-pprint-console-0.0.1.0: Wadler/Leijen style pretty printer supporting colorful console output.

CopyrightDaniel Mendler (c) 2016
LicenseMIT (see the file LICENSE)
Maintainermail@daniel-mendler.de
Stabilityexperimental
Portabilityportable
Safe HaskellSafe
LanguageHaskell2010

Text.PrettyPrint.Console.WL

Contents

Description

This is a pretty printer with support for annotations. The annotations can be mapped to ANSI escape sequences to allow for colorful output on consoles. For this purpose the console-style library is used.

Synopsis

Documentation

Display documents annotated with pair of strings

displayWrapped :: Monoid o => (String -> o) -> SimpleDoc (String, String) -> o Source #

Display a rendered document which is annotated with pairs of strings and output a Monoid.

The first element of the pair is prepended to the annotated region, the second after the annotated region.

displayWrappedT :: SimpleDoc (String, String) -> Text Source #

Display a rendered document which is annotated with pairs of strings and output Text.

The first element of the pair is prepended to the annotated region, the second after the annotated region.

displayWrappedS :: SimpleDoc (String, String) -> ShowS Source #

Display a rendered document which is annotated with pairs of strings and output a ShowS function.

The first element of the pair is prepended to the annotated region, the second after the annotated region.

Display as HTML

displayHTML :: Monoid o => (String -> o) -> (a -> String) -> SimpleDoc a -> o Source #

Display a rendered document as HTML and output a Monoid.

The annotated region is wrapped by span with the 'class' attribute given by the annotation function.

displayHTMLT :: (a -> String) -> SimpleDoc a -> Text Source #

Display a rendered document as HTML and output Text.

The annotated region is wrapped by span with the 'class' attribute given by the annotation function.

displayHTMLS :: (a -> String) -> SimpleDoc a -> ShowS Source #

Display a rendered document as HTML and output a ShowS function.

The annotated region is wrapped by span with the 'class' attribute given by the annotation function.

Display with ANSI escape sequences

displayStyleCode :: Monoid o => (String -> o) -> (a -> [SetStyle]) -> Term -> SimpleDoc a -> o Source #

Display a rendered document with ANSI escape sequences and output a Monoid.

The annotations are mapped to a '[SetStyle]' array.

displayStyleCodeT :: (a -> [SetStyle]) -> Term -> SimpleDoc a -> Text Source #

Display a rendered document with ANSI escape sequences and output Text.

The annotations are mapped to a '[SetStyle]' array.

displayStyleCodeS :: (a -> [SetStyle]) -> Term -> SimpleDoc a -> ShowS Source #

Display a rendered document with ANSI escape sequences and output a ShowS function.

The annotations are mapped to a '[SetStyle]' array.

Display to a file handle with ANSI escape sequences

hDisplayStyle :: MonadIO m => Handle -> (a -> [SetStyle]) -> SimpleDoc a -> m () Source #

Display a rendered document with ANSI escape sequences to a given Handle.

The annotations are mapped to a '[SetStyle]' array.

displayStyle :: MonadIO m => (a -> [SetStyle]) -> SimpleDoc a -> m () Source #

Display a rendered document with ANSI escape sequences to stdout.

The annotations are mapped to a '[SetStyle]' array.

hPutDocStyle :: Handle -> (a -> [SetStyle]) -> Doc a -> IO () Source #

The action (hPutDocStyle handle f doc) pretty prints document doc to file handle handle using the annotations.

The annotations are mapped by f to [SetStyle] arrays.

putDocStyle :: (a -> [SetStyle]) -> Doc a -> IO () Source #

The action (putDocStyle f doc) pretty prints document doc to standard output using the annotations.

The annotations are mapped by f to [SetStyle] arrays.