The abstract data type Doc ann represents pretty documents that have
been annotated with data of type ann.
More specifically, a value of type Doc represents a non-empty set of
possible layouts of a document. The layout functions select one of these
possibilities, taking into account things like the width of the output
document.
The annotation is an arbitrary piece of data associated with (part of) a document. Annotations may be used by the rendering backends in order to display output differently, such as
color information (e.g. when rendering to the terminal)
mouseover text (e.g. when rendering to rich HTML)
whether to show something or not (to allow simple or detailed versions)
The simplest way to display a Doc is via the Show class.
putStrLn (show (vsep ["hello", "world"]))helloworld
Instances7Functor, Show, IsString, Generic, Semigroup, Monoid, …
Functor DocDefined in prettyprinter-1.7.1 · Prettyprinter.InternalAlter the document’s annotations.
This instance makes Doc more flexible (because it can be used in Functor-polymorphic values), but
fmapis much less readable compared to usingreAnnotatein code that only works forDocanyway. Consider using the latter when the type does not matter.Show (Doc ann)Defined in prettyprinter-1.7.1 · Prettyprinter.Internal(show doc)prettyprints documentdocwith defaultLayoutOptions, ignoring all annotations.IsString (Doc ann)Defined in prettyprinter-1.7.1 · Prettyprinter.InternalGeneric (Doc ann)Defined in prettyprinter-1.7.1 · Prettyprinter.InternalSemigroup (Doc ann)Defined in prettyprinter-1.7.1 · Prettyprinter.InternalMonoid (Doc ann)Defined in prettyprinter-1.7.1 · Prettyprinter.Internaltype Rep (Doc ann) = D1 ('MetaDataDefined in prettyprinter-1.7.1 · Prettyprinter.Internal"Doc"
"Prettyprinter.Internal"
"prettyprinter-1.7.1-HHxuhFuLsfvKGXtl3TXc21"
'False) (((C1 ('MetaCons"Fail"
'PrefixI 'False) U1 :+: (C1 ('MetaCons"Empty"
'PrefixI 'False) U1 :+: C1 ('MetaCons"Char"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Char)))) :+: (C1 ('MetaCons"Text"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Int) :*: S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text)) :+: (C1 ('MetaCons"Line"
'PrefixI 'False) U1 :+: C1 ('MetaCons"FlatAlt"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Doc ann)) :*: S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Doc ann)))))) :+: ((C1 ('MetaCons"Cat"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Doc ann)) :*: S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Doc ann))) :+: (C1 ('MetaCons"Nest"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Int) :*: S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Doc ann))) :+: C1 ('MetaCons"Union"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Doc ann)) :*: S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Doc ann))))) :+: ((C1 ('MetaCons"Column"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Int -> Doc ann))) :+: C1 ('MetaCons"WithPageWidth"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (PageWidth -> Doc ann)))) :+: (C1 ('MetaCons"Nesting"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Int -> Doc ann))) :+: C1 ('MetaCons"Annotated"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ann) :*: S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Doc ann)))))))