pretty package:mainland-pretty

Render and convert a document to a Doc.
Render and convert a document to a Doc compactly.
Render and display a document compactly.
Render and display a document as Text. Uses a builder.
Render and convert a document to a Doc with #line pragmas.
> let loc = Loc (Pos "filename" 3 5 7) (Pos "filename" 5 7 9)
> in  putStrLn $ prettyPragma 80 $ srcloc loc <> text "foo" </> text "bar" </> text "baz"
will be printed as
foo
#line 3 "filename"
bar
baz
Render and convert a document to Text with #line pragmas. Uses a builder.
Render and display a document with #line pragmas.
Render and display a document.
Pretty printing designed for printing source code. Pretty printing designed for printing source code based on Wadler's paper A Prettier Printer. The main advantage of this library is its ability to automatically track the source locations associated with pretty printed values and output appropriate #line pragmas and its ability to produce output in the form of lazy text using a builder.