Courtesy of Philip Wadler.
This is a port of Prof. Philip Wadlers pretty printer library to Frege. For more info see "http://homepages.inf.ed.ac.uk/wadler/papers/prettier/prettier.pdf"
-
data DOCUMENT
-
Constructors
-
APPEND DOCUMENT DOCUMENT
-
-
GROUP DOCUMENT DOCUMENT
infixr 9
-
-
LINE
-
-
NEST Int DOCUMENT
-
-
NONE
-
-
TEXT (String)
-
-
data Doc
-
Constructors
-
Line {ind ∷ Int, doc ∷ Doc}
-
-
None
-
-
Text {hd ∷ String, doc ∷ Doc}
-
Member Functions
-
doc ∷ Doc → Doc
-
access field doc
-
hd ∷ Doc → String
-
access field hd
-
ind ∷ Doc → Int
-
access field ind
-
<> ∷ DOCUMENT → DOCUMENT → DOCUMENT
infixr 6
-
-
nest ∷ Int → DOCUMENT → DOCUMENT
-
-
text ∷ String → DOCUMENT
-
-
group ∷ DOCUMENT → DOCUMENT
-
-
flatten ∷ DOCUMENT → DOCUMENT
-
-
layout' ∷ Doc → String
-
-
layout ∷ Doc → ST 𝖆 String
-
-
appendableFromWriter ∷ MutableIO Writer → STMutable RealWorld Appendable
native (Appendable)
-
-
prettyIO ∷ MutableIO Writer → Int → DOCUMENT → IO ()
-
-
blanks64 ∷ String
-
-
data PDOC
-
Constructors
-
PDOC {off ∷ Int, doc ∷ DOCUMENT}
-
Member Functions
-
doc ∷ PDOC → DOCUMENT
-
access field doc
-
off ∷ PDOC → Int
-
access field off
-
best ∷ Int → Int → DOCUMENT → Doc
-
-
be ∷ Int → Int → [PDOC] → Doc
-
-
better ∷ Int → Int → Doc → Maybe Doc
-
-
fits ∷ Int → Doc → Bool
-
-
pretty ∷ Int → DOCUMENT → String
-
-
<+> ∷ DOCUMENT → DOCUMENT → DOCUMENT
infixr 8
-
two documents with intervening space
-
</> ∷ DOCUMENT → DOCUMENT → DOCUMENT
infixr 7
-
two documents stacked
-
folddoc ∷ (DOCUMENT→DOCUMENT→DOCUMENT) → [DOCUMENT] → DOCUMENT
-
-
spread ∷ [DOCUMENT] → DOCUMENT
-
some documents with space inbetween
-
stack ∷ [DOCUMENT] → DOCUMENT
-
some documents stacked
-
bracket ∷ String → DOCUMENT → String → DOCUMENT
-
-
block ∷ String → DOCUMENT → String → DOCUMENT
-
-
<~/> ∷ DOCUMENT → DOCUMENT → DOCUMENT
infixr 7
-
join two documents without intervening space or stack them
-
<+/> ∷ DOCUMENT → DOCUMENT → DOCUMENT
infixr 7
-
join two documents with intervening space or stack them
-
fill ∷ [DOCUMENT] → DOCUMENT
-
-
sep ∷ String → [DOCUMENT] → DOCUMENT
-
like fill, but with separator between items
-
tight ∷ String → [DOCUMENT] → DOCUMENT
-
like sep, but no space after separator
-
break ∷ String → [DOCUMENT]
-
fill words of a string
-
msgdoc ∷ String → DOCUMENT
-
turn a string into a document by breaking on space and filling up