Emit colored messages
It would be nice to have GHC-style colored error and warning messages:
Emitting these requires using an ANSI color library, for example ansi-terminal
.
It would, however, be preferable to have color support directly in the pretty printing library rather than just including raw ANSI escape sequences as text. There are a bunch of options here, but none of them really are a fitting 'drop-in-replacement' for the currently used pretty printer:
-
Hughes/PJ pretty printers:
-
pretty
is currently used and does not support ANSI coloring
-
-
Wadler/Leijen pretty printers:
-
ansi-wl-pprint
has ANSI coloring support, but may get deprecated -
ansi-pretty
is an extension ofansi-wl-pprint
-
prettyprinter
is modern and supports ANSI coloring, but usesData.Text
instead ofString
-
Additionally, Wadler/Leijen pretty printers have a lot of subtle differences in their API compared to Hughes/PJ printers, thereby complicating a potential migration. This includes many of them providing their own Pretty
class.