Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Prettyprinter.Convert.AnsiWlPprint
Description
Convert back and forth between the Doc
type of the ansi-wl-pprint
and the Doc
of the prettyprinter package. Useful in order to use the
prettyprinter
library together with another library that produces
ansi-wl-pprint
output, and vice versa.
╭────────────────────╮fromAnsiWlPprint
╭────────────────────╮ │Doc
├───────────────────────▷│Doc
AnsiStyle
│ │ (ansi-wl-pprint) │◁───────────────────────┤ (prettyprinter) │ ╰────────────────────╯toAnsiWlPprint
╰────────────────────╯
These conversion functions work well, but strictly speaking they are not
inverses of each other. ansi-wl-pprint
supports slightly less features than
prettyprinter
– the latter has italics, and allows reacting on the
configured ribbon width via withPageWidth
.
Synopsis
- fromAnsiWlPprint :: Doc -> Doc AnsiStyle
- toAnsiWlPprint :: Doc AnsiStyle -> Doc