Idris2Doc : Libraries.Text.PrettyPrint.Prettyprinter.Doc

Libraries.Text.PrettyPrint.Prettyprinter.Doc

(source)

Reexports

importpublic Data.List1
importpublic Libraries.Data.Span

Definitions

textReplicateChar : Int->Char->String
Totality: total
Visibility: export
textSpaces : Int->String
Totality: total
Visibility: export
dataPageWidth : Type
  Maximum number of characters that fit in one line.

Totality: total
Visibility: public export
Constructors:
AvailablePerLine : Int->Double->PageWidth
  The `Int` is the number of characters, including whitespace, that fit in a line.
The `Double` is the ribbon, the fraction of the toal page width that can be printed on.
Unbounded : PageWidth
  The layouters should not introduce line breaks.
dataFusionDepth : Type
  Fusion depth parameter.

Totality: total
Visibility: public export
Constructors:
Shallow : FusionDepth
  Do not dive deep into nested documents.
Deep : FusionDepth
  Recurse into all parts of the `Doc`. May impact performace.
dataDoc : Type->Type
  This data type represents pretty documents that have
been annotated with an arbitrary data type `ann`.

Totality: total
Visibility: public export
Constructors:
Empty : Docann
Chara : Char->Docann
Text : Int->String->Docann
Line : Docann
FlatAlt : Lazy (Docann) -> Lazy (Docann) ->Docann
Cat : Docann->Docann->Docann
Nest : Int->Docann->Docann
Union : Lazy (Docann) -> Lazy (Docann) ->Docann
Column : (Int->Docann) ->Docann
WithPageWidth : (PageWidth->Docann) ->Docann
Nesting : (Int->Docann) ->Docann
Annotated : ann->Docann->Docann

Hints:
Cast (DocVoid) (Docann)
FromString (Docann)
FunctorDoc
Monoid (Docann)
Semigroup (Docann)
Show (Docann)
column : (Int->Docann) ->Docann
  Layout a document depending on which column it starts at.

Totality: total
Visibility: export
nest : Int->Docann->Docann
  Lays out a document with the current nesting level increased by `i`.

Totality: total
Visibility: export
nesting : (Int->Docann) ->Docann
  Layout a document depending on the current nesting level.

Totality: total
Visibility: export
width : Docann-> (Int->Docann) ->Docann
  Lays out a document, and makes the column width of it available to a function.

Totality: total
Visibility: export
pageWidth : (PageWidth->Docann) ->Docann
  Layout a document depending on the page width, if one has been specified.

Totality: total
Visibility: export
align : Docann->Docann
  Lays out a document with the nesting level set to the current column.

Totality: total
Visibility: export
hang : Int->Docann->Docann
  Lays out a document with a nesting level set to the current column plus `i`.
Negative values are allowed, and decrease the nesting level accordingly.

Totality: total
Visibility: export
replicateChar : Int->Char->Docann
  Repeat character `n` times.

Totality: total
Visibility: export
spaces : Int->Docann
  Insert a number of spaces.

Totality: total
Visibility: export
indent : Int->Docann->Docann
  Indents a document with `i` spaces, starting from the current cursor position.

Totality: total
Visibility: export
fill : Int->Docann->Docann
  Lays out a document. It then appends spaces until the width is equal to `i`.
If the width is already larger, nothing is appended.

Totality: total
Visibility: export
(<++>) : Docann->Docann->Docann
  Concatenates two documents with a space in between.

Totality: total
Visibility: export
Fixity Declaration: infixr operator, level 6
emptyDoc : Docann
  The empty document behaves like `pretty ""`, so it has a height of 1.

Totality: total
Visibility: export
softline : Docann
  Behaves like `space` if the resulting output fits the page, otherwise like `line`.

Totality: total
Visibility: export
softline' : Docann
  Like `softline`, but behaves like `neutral` if the resulting output does not fit
on the page.

Totality: total
Visibility: export
hardline : Docann
  A line break, even when grouped.

Totality: total
Visibility: export
group : Docann->Docann
  Tries laying out a document into a single line by removing the contained
line breaks; if this does not fit the page, or has an `hardline`, the document
is laid out without changes.

Totality: total
Visibility: export
flatAlt : Lazy (Docann) -> Lazy (Docann) ->Docann
  By default renders the first document, When grouped renders the second, with
the first as fallback when there is not enough space.

Totality: total
Visibility: export
line : Docann
  Advances to the next line and indents to the current nesting level.

Totality: total
Visibility: export
line' : Docann
  Like `line`, but behaves like `neutral` if the line break is undone by `group`.

Totality: total
Visibility: export
fillBreak : Int->Docann->Docann
  First lays out the document. It then appends spaces until the width is equal to `i`.
If the width is already larger than `i`, the nesting level is decreased by `i`
and a line is appended.

Totality: total
Visibility: export
concatWith : (Docann->Docann->Docann) ->List (Docann) ->Docann
  Concatenate all documents element-wise with a binary function.

Totality: total
Visibility: export
hsep : List (Docann) ->Docann
  Concatenates all documents horizontally with `(<++>)`.

Totality: total
Visibility: export
vsep : List (Docann) ->Docann
  Concatenates all documents above each other. If a `group` undoes the line breaks,
the documents are separated with a space instead.

Totality: total
Visibility: export
fillSep : List (Docann) ->Docann
  Concatenates the documents horizontally with `(<++>)` as long as it fits the page,
then inserts a line and continues.

Totality: total
Visibility: export
sep : List (Docann) ->Docann
  Tries laying out the documents separated with spaces and if this does not fit,
separates them with newlines.

Totality: total
Visibility: export
hcat : List (Docann) ->Docann
  Concatenates all documents horizontally with `(<+>)`.

Totality: total
Visibility: export
vcat : List (Docann) ->Docann
  Vertically concatenates the documents. If it is grouped, the line breaks are removed.

Totality: total
Visibility: export
fillCat : List (Docann) ->Docann
  Concatenates documents horizontally with `(<+>)` as log as it fits the page, then
inserts a line and continues.

Totality: total
Visibility: export
cat : List (Docann) ->Docann
  Tries laying out the documents separated with nothing, and if it does not fit the page,
separates them with newlines.

Totality: total
Visibility: export
punctuate : Docann->List (Docann) ->List (Docann)
  Appends `p` to all but the last document.

Totality: total
Visibility: export
plural : (Numamount, Eqamount) =>doc->doc->amount->doc
Totality: total
Visibility: export
enclose : Docann->Docann->Docann->Docann
  Encloses the document between two other documents using `(<+>)`.

Totality: total
Visibility: export
surround : Docann->Docann->Docann->Docann
  Reordering of `encloses`.
Example: concatWith (surround (pretty ".")) [pretty "Text", pretty "PrettyPrint", pretty "Doc"]
Text.PrettyPrint.Doc

Totality: total
Visibility: export
encloseSep : Docann->Docann->Docann->List (Docann) ->Docann
  Concatenates the documents separated by `s` and encloses the resulting document by `l` and `r`.

Totality: total
Visibility: export
annotate : ann->Docann->Docann
  Adds an annotation to a document.

Totality: total
Visibility: export
alterAnnotations : (ann->Listann') ->Docann->Docann'
  Changes the annotations of a document. Individual annotations can be removed,
changed, or replaced by multiple ones.

Totality: total
Visibility: export
unAnnotate : Docann->Docxxx
  Removes all annotations.

Totality: total
Visibility: export
reAnnotate : (ann->ann') ->Docann->Docann'
  Changes the annotations of a document.

Totality: total
Visibility: export
interfacePretty : Type->Type->Type
  Overloaded conversion to `Doc`.
@ ann is the type of annotations
@ a is the type of things that can be prettified
We declare that only `a` is relevant when looking for an implementation

Pro tips:
1. use `prettyBy` if a subprinter uses a different type of annotations
2. use a variable `ann` rather than `Void` if no annnotation is needed
(to avoid needless calls to `prettyBy absurd`)

Parameters: ann, a
Methods:
pretty : a->Docann
prettyPrec : Prec->a->Docann

Implementations:
PrettyVoidToken
PrettyVoidPkgVersion
PrettyVoidPkgVersionBounds
PrettyVoidDepends
PrettyVoidPkgDesc
PrettyIdrisDocAnnCDef
PrettyIdrisSyntax (NamedPatstodovars)
PrettyIdrisSyntax (PatClausetodovars)
PrettyVoidSExpToken
PrettyIdrisSyntaxPremise
PrettyVoidStopReason
PrettyVoidToken
Prettyia=>Prettyi (WithFCa)
PrettyIdrisSyntax (BasicMultiBinder'KindedName)
PrettyIdrisSyntax (PBinder'KindedName)
PrettyIdrisSyntaxIPTerm
PrettyVoidREPLEval
PrettyVoidREPLOpt
PrettyIdrisSyntaxPat
PrettyannDotReason
PrettyVoidFC
PrettyIdrisSyntaxPrimType
PrettyIdrisSyntaxConstant
PrettyVoidVisibility
PrettyVoidPartialReason
PrettyVoidTerminating
PrettyVoidCovering
PrettyVoidTotality
PrettyVoidNamespace
PrettyVoidModuleIdent
PrettyVoidUserName
PrettyVoidName
PrettyVoidString
PrettyVoidChar
PrettyVoidSizeChange
pretty : Prettyanna=>a->Docann
Totality: total
Visibility: public export
prettyPrec : Prettyanna=>Prec->a->Docann
Totality: total
Visibility: public export
prettyBy : Prettyann1a=> (ann1->ann2) ->a->Docann2
  Sometimes we want to call a subprinter that uses a different annotation
type. That's fine as long as we know how to embed such annotations into
the target ones.
@ ann1 is the type of annotations used by the subprinter
@ ann2 is the type of annotations used in the current document
@ inj explains how to inject the first into the second

Totality: total
Visibility: export
pretty0 : PrettyVoida=>a->Docann
  Sometimes we want to call a subprinter that uses no annotation whatsoever.
This should be equivalent to `prettyBy absurd`, except that in this case
we do not traverse the document because it should be impossible to manufacture
an annotation of type Void.

Totality: total
Visibility: export
byShow : Showa=>a->Docann
Totality: total
Visibility: export
commaSep : List (Docann) ->Docann
Totality: total
Visibility: export
list : List (Docann) ->Docann
  Variant of `encloseSep` with braces and comma as separator.

Totality: total
Visibility: export
tupled : List (Docann) ->Docann
  Variant of `encloseSep` with parentheses and comma as separator.

Totality: total
Visibility: export
prettyList : Prettyanna=>Lista->Docann
Totality: total
Visibility: export
prettyList1 : Prettyanna=>List1a->Docann
Totality: total
Visibility: export
prettyMaybe : Prettyanna=>Maybea->Docann
Totality: total
Visibility: export
fuse : FusionDepth->Docann->Docann
  Combines text nodes so they can be rendered more efficiently.

Totality: total
Visibility: export
dataSimpleDocStream : Type->Type
  This data type represents laid out documents and is used by the display functions.

Totality: total
Visibility: public export
Constructors:
SEmpty : SimpleDocStreamann
SChar : Char-> Lazy (SimpleDocStreamann) ->SimpleDocStreamann
SText : Int->String-> Lazy (SimpleDocStreamann) ->SimpleDocStreamann
SLine : Int->SimpleDocStreamann->SimpleDocStreamann
SAnnPush : ann->SimpleDocStreamann->SimpleDocStreamann
SAnnPop : SimpleDocStreamann->SimpleDocStreamann

Hint: 
FunctorSimpleDocStream
alterAnnotationsS : (ann->Maybeann') ->SimpleDocStreamann->SimpleDocStreamann'
  Changes the annotation of a document to a different annotation or none.

Totality: total
Visibility: export
unAnnotateS : SimpleDocStreamann->SimpleDocStreamxxx
  Removes all annotations.

Totality: total
Visibility: export
reAnnotateS : (ann->ann') ->SimpleDocStreamann->SimpleDocStreamann'
  Changes the annotation of a document.

Totality: total
Visibility: export
collectAnnotations : Monoidm=> (ann->m) ->SimpleDocStreamann->m
  Collects all annotations from a document.

Totality: total
Visibility: export
traverse : Applicativef=> (ann->fann') ->SimpleDocStreamann->f (SimpleDocStreamann')
  Transform a document based on its annotations.

Totality: total
Visibility: export
removeTrailingWhitespace : SimpleDocStreamann->SimpleDocStreamann
  Removes all trailing space characters.

Totality: total
Visibility: export
FittingPredicate : Type->Type
Totality: total
Visibility: public export
defaultPageWidth : PageWidth
Totality: total
Visibility: export
recordLayoutOptions : Type
Totality: total
Visibility: public export
Constructor: 
MkLayoutOptions : PageWidth->LayoutOptions

Projection: 
.layoutPageWidth : LayoutOptions->PageWidth
.layoutPageWidth : LayoutOptions->PageWidth
Totality: total
Visibility: public export
layoutPageWidth : LayoutOptions->PageWidth
Totality: total
Visibility: public export
defaultLayoutOptions : LayoutOptions
Totality: total
Visibility: export
layoutWadlerLeijen : FittingPredicateann->PageWidth->Docann->SimpleDocStreamann
  The Wadler/Leijen layout algorithm.

Totality: total
Visibility: export
layoutUnbounded : Docann->SimpleDocStreamann
  Layout a document with unbounded page width.

Totality: total
Visibility: export
layoutPretty : LayoutOptions->Docann->SimpleDocStreamann
  The default layout algorithm.

Totality: total
Visibility: export
layoutSmart : LayoutOptions->Docann->SimpleDocStreamann
  Layout algorithm with more lookahead than layoutPretty.

Totality: total
Visibility: export
layoutCompact : Docann->SimpleDocStreamann
  Lays out the document without adding any indentation. This layouter is very fast.

Totality: total
Visibility: export
renderShow : SimpleDocStreamann->String->String
Totality: total
Visibility: export
displaySpans : SimpleDocStreama-> (String, List (Spana))
Totality: total
Visibility: export