| Copyright | Daniel Mendler (c) 2016 |
|---|---|
| License | MIT (see the file LICENSE) |
| Maintainer | mail@daniel-mendler.de |
| Stability | experimental |
| Portability | portable |
| Safe Haskell | Safe |
| Language | Haskell2010 |
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.
- module Text.PrettyPrint.Annotated.WL
- displayWrapped :: Monoid o => (String -> o) -> SimpleDoc (String, String) -> o
- displayWrappedT :: SimpleDoc (String, String) -> Text
- displayWrappedS :: SimpleDoc (String, String) -> ShowS
- displayHTML :: Monoid o => (String -> o) -> (a -> String) -> SimpleDoc a -> o
- displayHTMLT :: (a -> String) -> SimpleDoc a -> Text
- displayHTMLS :: (a -> String) -> SimpleDoc a -> ShowS
- displayStyleCode :: Monoid o => (String -> o) -> (a -> [SetStyle]) -> Term -> SimpleDoc a -> o
- displayStyleCodeT :: (a -> [SetStyle]) -> Term -> SimpleDoc a -> Text
- displayStyleCodeS :: (a -> [SetStyle]) -> Term -> SimpleDoc a -> ShowS
- hDisplayStyle :: MonadIO m => Handle -> (a -> [SetStyle]) -> SimpleDoc a -> m ()
- displayStyle :: MonadIO m => (a -> [SetStyle]) -> SimpleDoc a -> m ()
- hPutDocStyle :: Handle -> (a -> [SetStyle]) -> Doc a -> IO ()
- putDocStyle :: (a -> [SetStyle]) -> Doc a -> IO ()
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
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.