| Safe Haskell | Safe-Inferred | 
|---|---|
| Language | Haskell2010 | 
PlutusCore.Pretty
Synopsis
- data Doc ann
- class Pretty a where- pretty ∷ a → Doc ann
- prettyList ∷ [a] → Doc ann
 
- class PrettyBy config a where- prettyBy ∷ config → a → Doc ann
- prettyListBy ∷ config → [a] → Doc ann
 
- newtype IgnorePrettyConfig a = IgnorePrettyConfig {}
- data AttachPrettyConfig config a = AttachPrettyConfig !config !a
- class Render str where
- type PrettyParens = PrettyBy RenderContext
- display ∷ ∀ str a. (Pretty a, Render str) ⇒ a → str
- displayBy ∷ ∀ str a config. (PrettyBy config a, Render str) ⇒ config → a → str
- juxtRenderContext ∷ RenderContext
- prettyPlc ∷ PrettyPlc a ⇒ a → Doc ann
- displayPlc ∷ (PrettyPlc a, Render str) ⇒ a → str
- prettyPlcSimple ∷ PrettyPlc a ⇒ a → Doc ann
- displayPlcSimple ∷ (PrettyPlc a, Render str) ⇒ a → str
- data CondensedErrors
- type DefaultPrettyPlcStrategy a = (PrettyClassic a, PrettyReadable a)
- newtype PrettyConfigPlcOptions = PrettyConfigPlcOptions {}
- data PrettyConfigPlcStrategy
- data PrettyConfigPlc = PrettyConfigPlc {}
- type PrettyPlc = PrettyBy PrettyConfigPlc
- prettyConfigPlcOptions ∷ PrettyConfigPlcOptions
- prettyConfigPlcClassic ∷ PrettyConfigPlcOptions → PrettyConfigPlc
- prettyConfigPlcClassicSimple ∷ PrettyConfigPlcOptions → PrettyConfigPlc
- prettyConfigPlcReadable ∷ PrettyConfigPlcOptions → PrettyConfigPlc
- prettyConfigPlcReadableSimple ∷ PrettyConfigPlcOptions → PrettyConfigPlc
- prettyPlcClassic ∷ PrettyPlc a ⇒ a → Doc ann
- prettyPlcClassicSimple ∷ PrettyPlc a ⇒ a → Doc ann
- prettyPlcReadable ∷ PrettyPlc a ⇒ a → Doc ann
- prettyPlcReadableSimple ∷ PrettyPlc a ⇒ a → Doc ann
- prettyPlcCondensedErrorBy ∷ PrettyPlc a ⇒ (PrettyConfigPlcOptions → PrettyConfigPlc) → a → Doc ann
- displayPlcCondensedErrorClassic ∷ (PrettyPlc a, Render str) ⇒ a → str
- newtype PrettyConfigName = PrettyConfigName {}
- class HasPrettyConfigName config where- toPrettyConfigName ∷ config → PrettyConfigName
 
- prettyConfigName ∷ PrettyConfigName
- prettyConfigNameSimple ∷ PrettyConfigName
- data PrettyConfigClassic configName = PrettyConfigClassic {- _pccConfigName ∷ configName
- _pccDisplayAnn ∷ Bool
 
- type PrettyClassicBy configName = PrettyBy (PrettyConfigClassic configName)
- type PrettyClassic = PrettyClassicBy PrettyConfigName
- consAnnIf ∷ Pretty ann ⇒ PrettyConfigClassic configName → ann → [Doc dann] → [Doc dann]
- prettyClassic ∷ PrettyClassic a ⇒ a → Doc ann
- prettyClassicSimple ∷ PrettyClassic a ⇒ a → Doc ann
- data ShowKinds
- data PrettyConfigReadable configName = PrettyConfigReadable {- _pcrConfigName ∷ configName
- _pcrRenderContext ∷ RenderContext
- _pcrShowKinds ∷ ShowKinds
 
- prettyReadable ∷ PrettyReadable a ⇒ a → Doc ann
- prettyReadableSimple ∷ PrettyReadable a ⇒ a → Doc ann
- pcrConfigName ∷ ∀ configName configName. Lens (PrettyConfigReadable configName) (PrettyConfigReadable configName) configName configName
- pcrRenderContext ∷ ∀ configName. Lens' (PrettyConfigReadable configName) RenderContext
- pcrShowKinds ∷ ∀ configName. Lens' (PrettyConfigReadable configName) ShowKinds
- type PrettyReadableBy configName = PrettyBy (PrettyConfigReadable configName)
- type PrettyReadable = PrettyReadableBy PrettyConfigName
- newtype AsReadable a = AsReadable {- unAsReadable ∷ a
 
- data Parened a = Parened {}
- inBraces ∷ a → Parened a
- topPrettyConfigReadable ∷ configName → ShowKinds → PrettyConfigReadable configName
- botPrettyConfigReadable ∷ configName → ShowKinds → PrettyConfigReadable configName
- binderFixity ∷ Fixity
- arrowFixity ∷ Fixity
- iterTyForallPrettyM ∷ (MonadPrettyReadable configName env m, PrettyReadableBy configName arg, PrettyReadableBy configName body) ⇒ [arg] → body → m (Doc ann)
- iterLamAbsPrettyM ∷ (MonadPrettyReadable configName env m, PrettyReadableBy configName arg, PrettyReadableBy configName body) ⇒ [arg] → body → m (Doc ann)
- iterTyAbsPrettyM ∷ (MonadPrettyReadable configName env m, PrettyReadableBy configName arg, PrettyReadableBy configName body) ⇒ [arg] → body → m (Doc ann)
- iterArrowPrettyM ∷ (MonadPrettyReadable configName env m, PrettyReadableBy configName a) ⇒ [a] → a → m (Doc ann)
- iterAppDocM ∷ MonadPrettyContext config env m ⇒ (AnyToDoc config ann → AnyToDoc config ann → NonEmpty (Doc ann)) → m (Doc ann)
- iterInterAppPrettyM ∷ (MonadPrettyReadable configName env m, PrettyReadableBy configName fun, PrettyReadableBy configName ty, PrettyReadableBy configName term) ⇒ fun → [Either ty term] → m (Doc ann)
- iterAppPrettyM ∷ (MonadPrettyContext config env m, PrettyBy config fun, PrettyBy config term) ⇒ fun → [term] → m (Doc ann)
- prettyBytes ∷ ByteString → Doc ann
- newtype ConstConfig = ConstConfig {}
- type PrettyConst = PrettyBy ConstConfig
- type PrettyUni uni = (PrettyParens (SomeTypeIn uni), Closed uni, uni `Everywhere` PrettyConst)
- type ThrowableBuiltins uni fun = (PrettyUni uni, Pretty fun, Typeable uni, Typeable fun)
- prettyConst ∷ PrettyConst a ⇒ RenderContext → a → Doc ann
- module Text.PrettyBy.Fixity
Basic types and functions
The abstract data type Doc annann.
More specifically, a value of type Doc
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"]))hello world
Instances
Minimal complete definition
Methods
>>>pretty 1 <+> pretty "hello" <+> pretty 1.2341 hello 1.234
prettyList ∷ [a] → Doc ann Source #
prettyListinstance
 . In normal circumstances only the Pretty a => Pretty [a]pretty
>>>prettyList [1, 23, 456][1, 23, 456]
Instances
class PrettyBy config a where Source #
A class for pretty-printing values in a configurable manner.
A basic example:
>>>data Case = UpperCase | LowerCase>>>data D = D>>>instance PrettyBy Case D where prettyBy UpperCase D = "D"; prettyBy LowerCase D = "d">>>prettyBy UpperCase DD>>>prettyBy LowerCase Dd
The library provides instances for common types like Integer or Bool, so you can't define
 your own PrettyBy SomeConfig Integer instance. And for the same reason you should not define
 instances like PrettyBy SomeAnotherConfig a for universally quantified a, because such an
 instance would overlap with the existing ones. Take for example
>>>data ViaShow = ViaShow>>>instance Show a => PrettyBy ViaShow a where prettyBy ViaShow = pretty . show
with such an instance prettyBy ViaShow (1 :: Int) throws an error about overlapping instances:
• Overlapping instances for PrettyBy ViaShow Int
    arising from a use of ‘prettyBy’
  Matching instances:
    instance PrettyDefaultBy config Int => PrettyBy config Int
    instance [safe] Show a => PrettyBy ViaShow aThere's a newtype provided specifically for the purpose of defining a PrettyBy instance for
 any a: PrettyAny. Read its docs for details on when you might want to use it.
The PrettyBy instance for common types is defined in a way that allows to override default
 pretty-printing behaviour, read the docs of HasPrettyDefaults for details.
Minimal complete definition
Nothing
Methods
prettyBy ∷ config → a → Doc ann Source #
Pretty-print a value of type a the way a config specifies it.
 The default implementation of prettyBy is in terms of pretty, defaultPrettyFunctorBy
 or defaultPrettyBifunctorBy depending on the kind of the data type that you're providing
 an instance for. For example, the default implementation of prettyBy for a monomorphic type
 is going to be "ignore the config and call pretty over the value":
>>>newtype N = N Int deriving newtype (Pretty)>>>instance PrettyBy () N>>>prettyBy () (N 42)42
The default implementation of prettyBy for a Functor is going to be in terms of
 defaultPrettyFunctorBy:
>>>newtype N a = N a deriving stock (Functor) deriving newtype (Pretty)>>>instance PrettyBy () a => PrettyBy () (N a)>>>prettyBy () (N (42 :: Int))42
It's fine for the data type to have a phantom parameter as long as the data type is still a
 Functor (i.e. the parameter has to be of kind Type). Then defaultPrettyFunctorBy is used
 again:
>>>newtype N a = N Int deriving stock (Functor) deriving newtype (Pretty)>>>instance PrettyBy () (N b)>>>prettyBy () (N 42)42
If the data type has a single parameter of any other kind, then it's not a functor and so
 like in the monomorphic case pretty is used:
>>>newtype N (b :: Bool) = N Int deriving newtype (Pretty)>>>instance PrettyBy () (N b)>>>prettyBy () (N 42)42
Same applies to a data type with two parameters: if both the parameters are of kind Type,
 then the data type is assumed to be a Bifunctor and hence defaultPrettyBifunctorBy is
 used. If the right parameter is of kind Type and the left parameter is of any other kind,
 then we fallback to assuming the data type is a Functor and defining prettyBy as
 defaultPrettyFunctorBy. If both the parameters are not of kind Type, we fallback to
 implementing prettyBy in terms of pretty like in the monomorphic case.
Note that in all those cases a Pretty instance for the data type has to already exist,
 so that we can derive a PrettyBy one in terms of it. If it doesn't exist or if your data
 type is not supported (for example, if it has three or more parameters of kind Type), then
 you'll need to provide the implementation manually.
prettyListBy ∷ config → [a] → Doc ann Source #
prettyListBy is used to define the default PrettyBy instance for [a] and NonEmpty a.
 In normal circumstances only the prettyBy function is used.
 The default implementation of prettyListBy is in terms of defaultPrettyFunctorBy.
Instances
newtype IgnorePrettyConfig a Source #
A newtype wrapper around a whose point is to provide a PrettyBy config instance
 for anything that has a Pretty instance.
Constructors
| IgnorePrettyConfig | |
| Fields | |
Instances
| Pretty a ⇒ PrettyBy config (IgnorePrettyConfig a) | 
 | 
| Defined in Text.PrettyBy.Internal Methods prettyBy ∷ config → IgnorePrettyConfig a → Doc ann Source # prettyListBy ∷ config → [IgnorePrettyConfig a] → Doc ann Source # | |
data AttachPrettyConfig config a Source #
A config together with some value. The point is to provide a Pretty instance
 for anything that has a PrettyBy config instance.
Constructors
| AttachPrettyConfig !config !a | 
Instances
| PrettyBy config a ⇒ Pretty (AttachPrettyConfig config a) | 
 | 
| Defined in Text.PrettyBy.Internal Methods pretty ∷ AttachPrettyConfig config a → Doc ann Source # prettyList ∷ [AttachPrettyConfig config a] → Doc ann Source # | |
type PrettyParens = PrettyBy RenderContext Source #
For pretty-printing a value with a minimum amount of parens.
display ∷ ∀ str a. (Pretty a, Render str) ⇒ a → str Source #
Pretty-print and render a value as a string type.
displayBy ∷ ∀ str a config. (PrettyBy config a, Render str) ⇒ config → a → str Source #
Pretty-print and render a value as a string type in a configurable way.
juxtRenderContext ∷ RenderContext Source #
An initial RenderContext.
 An expression printed in this context gets enclosed in parens unless its outermost operator (if
 any) binds even stronger than function application.
Defaults
prettyPlc ∷ PrettyPlc a ⇒ a → Doc ann Source #
Pretty-print a value in the default mode using the classic view.
displayPlc ∷ (PrettyPlc a, Render str) ⇒ a → str Source #
Render a value to String in the default mode using the classic view.
prettyPlcSimple ∷ PrettyPlc a ⇒ a → Doc ann Source #
Pretty-print a value in the debug mode using the classic view.
displayPlcSimple ∷ (PrettyPlc a, Render str) ⇒ a → str Source #
Render a value to String in the debug mode using the classic view.
Global configuration
data CondensedErrors Source #
Whether to pretty-print PLC errors in full or with some information omitted.
Constructors
| CondensedErrorsYes | |
| CondensedErrorsNo | 
Instances
| Show CondensedErrors Source # | |
| Defined in PlutusCore.Pretty.Plc | |
| Eq CondensedErrors Source # | |
| Defined in PlutusCore.Pretty.Plc Methods | |
type DefaultPrettyPlcStrategy a = (PrettyClassic a, PrettyReadable a) Source #
A constraint that allows to derive PrettyBy PrettyConfigPlc instances, see below.
newtype PrettyConfigPlcOptions Source #
Options for pretty-printing PLC entities.
Constructors
| PrettyConfigPlcOptions | |
| Fields | |
Instances
| Show PrettyConfigPlcOptions Source # | |
| Defined in PlutusCore.Pretty.Plc | |
data PrettyConfigPlcStrategy Source #
Strategy for pretty-printing PLC entities.
Constructors
| PrettyConfigPlcClassic (PrettyConfigClassic PrettyConfigName) | |
| PrettyConfigPlcReadable (PrettyConfigReadable PrettyConfigName) | 
Instances
| Show PrettyConfigPlcStrategy Source # | |
| Defined in PlutusCore.Pretty.Plc | |
| HasPrettyConfigName PrettyConfigPlcStrategy Source # | |
| Defined in PlutusCore.Pretty.Plc | |
| DefaultPrettyPlcStrategy a ⇒ PrettyBy PrettyConfigPlcStrategy (PrettyAny a) Source # | |
| Defined in PlutusCore.Pretty.Plc Methods prettyBy ∷ PrettyConfigPlcStrategy → PrettyAny a → Doc ann Source # prettyListBy ∷ PrettyConfigPlcStrategy → [PrettyAny a] → Doc ann Source # | |
data PrettyConfigPlc Source #
Global configuration used for pretty-printing PLC entities.
Constructors
| PrettyConfigPlc | |
Instances
type PrettyPlc = PrettyBy PrettyConfigPlc Source #
The "pretty-printable PLC entity" constraint.
prettyConfigPlcOptions ∷ PrettyConfigPlcOptions Source #
The PrettyConfigPlcOptions used by default:
 print errors in full.
prettyConfigPlcClassic ∷ PrettyConfigPlcOptions → PrettyConfigPlc Source #
The PrettyConfigPlc used by default:
 use the classic view and print neither Uniques, nor name attachments.
prettyConfigPlcClassicSimple ∷ PrettyConfigPlcOptions → PrettyConfigPlc Source #
The PrettyConfigPlc used for debugging:
 use the classic view and print Uniques, but not name attachments.
prettyConfigPlcReadable ∷ PrettyConfigPlcOptions → PrettyConfigPlc Source #
The PrettyConfigPlc used by default and for readability:
 use the refined view and print Uniques but not name attachments.
prettyConfigPlcReadableSimple ∷ PrettyConfigPlcOptions → PrettyConfigPlc Source #
The PrettyConfigPlc used for debugging and readability:
 use the refined view and print neither Uniques nor name attachments.
Custom functions for PLC types.
prettyPlcClassic ∷ PrettyPlc a ⇒ a → Doc ann Source #
Pretty-print a PLC value in the default mode using the classic view.
prettyPlcClassicSimple ∷ PrettyPlc a ⇒ a → Doc ann Source #
Pretty-print a PLC value without unique indices using the classic view.
prettyPlcReadable ∷ PrettyPlc a ⇒ a → Doc ann Source #
Pretty-print a PLC value in the default mode using the readable view.
prettyPlcReadableSimple ∷ PrettyPlc a ⇒ a → Doc ann Source #
Pretty-print a PLC value without unique indices using the readable view.
prettyPlcCondensedErrorBy ∷ PrettyPlc a ⇒ (PrettyConfigPlcOptions → PrettyConfigPlc) → a → Doc ann Source #
Pretty-print a PLC value using the condensed way (see CondensedErrors)
 of pretty-printing PLC errors (in case there are any).
displayPlcCondensedErrorClassic ∷ (PrettyPlc a, Render str) ⇒ a → str Source #
Render an error to String in the condensed manner using the classic view.
Names
newtype PrettyConfigName Source #
A config that determines how to pretty-print a PLC name.
Constructors
| PrettyConfigName | |
| Fields 
 | |
Instances
class HasPrettyConfigName config where Source #
A class of configs from which a PrettyConfigName can be extracted.
Methods
toPrettyConfigName ∷ config → PrettyConfigName Source #
Instances
| HasPrettyConfigName PrettyConfigPlc Source # | |
| Defined in PlutusCore.Pretty.Plc Methods toPrettyConfigName ∷ PrettyConfigPlc → PrettyConfigName Source # | |
| HasPrettyConfigName PrettyConfigPlcStrategy Source # | |
| Defined in PlutusCore.Pretty.Plc | |
| configName ~ PrettyConfigName ⇒ HasPrettyConfigName (PrettyConfigClassic configName) Source # | |
| Defined in PlutusCore.Pretty.Classic Methods toPrettyConfigName ∷ PrettyConfigClassic configName → PrettyConfigName Source # | |
| configName ~ PrettyConfigName ⇒ HasPrettyConfigName (PrettyConfigReadable configName) Source # | |
| Defined in PlutusCore.Pretty.Readable Methods toPrettyConfigName ∷ PrettyConfigReadable configName → PrettyConfigName Source # | |
| HasPrettyConfigName (Sole PrettyConfigName) Source # | |
| Defined in PlutusCore.Pretty.ConfigName Methods toPrettyConfigName ∷ Sole PrettyConfigName → PrettyConfigName Source # | |
prettyConfigName ∷ PrettyConfigName Source #
The PrettyConfigName used by default: print Unique indexes after nams.
prettyConfigNameSimple ∷ PrettyConfigName Source #
The PrettyConfigName to be used when Unique indices don't matter. Easier to read.
Classic view
data PrettyConfigClassic configName Source #
Configuration for the classic pretty-printing.
Constructors
| PrettyConfigClassic | |
| Fields 
 | |
Instances
type PrettyClassicBy configName = PrettyBy (PrettyConfigClassic configName) Source #
The "classically pretty-printable" constraint.
consAnnIf ∷ Pretty ann ⇒ PrettyConfigClassic configName → ann → [Doc dann] → [Doc dann] Source #
Add a pretty-printed annotation to a list of Docs if the given config enables pretty-printing
 of annotations.
prettyClassic ∷ PrettyClassic a ⇒ a → Doc ann Source #
Pretty-print a value in the default mode using the classic view.
prettyClassicSimple ∷ PrettyClassic a ⇒ a → Doc ann Source #
Pretty-print a value in the simple mode using the classic view.
Readable view
Constructors
| ShowKindsYes | |
| ShowKindsNonType | |
| ShowKindsNo | 
data PrettyConfigReadable configName Source #
Configuration for the readable pretty-printing.
Constructors
| PrettyConfigReadable | |
| Fields 
 | |
Instances
prettyReadable ∷ PrettyReadable a ⇒ a → Doc ann Source #
Pretty-print something with the PrettyConfigReadable config.
prettyReadableSimple ∷ PrettyReadable a ⇒ a → Doc ann Source #
Pretty-print something with the PrettyConfigReadableSimple config.
pcrConfigName ∷ ∀ configName configName. Lens (PrettyConfigReadable configName) (PrettyConfigReadable configName) configName configName Source #
pcrRenderContext ∷ ∀ configName. Lens' (PrettyConfigReadable configName) RenderContext Source #
pcrShowKinds ∷ ∀ configName. Lens' (PrettyConfigReadable configName) ShowKinds Source #
type PrettyReadableBy configName = PrettyBy (PrettyConfigReadable configName) Source #
The "readably pretty-printable" constraint.
newtype AsReadable a Source #
For rendering things in a readable manner regardless of the pretty-printing function chosen.
I.e. all of show, pretty, prettyClassic will use PrettyReadable instead of doing what
they normally do. prettyBy config (AsReadable x) requires config to have a PrettyConfigName
and respects it.
This wrapper can be particularly useful if you want to apply a function having a Show or
Pretty or PrettyClassic or PrettyPlc or whatever constraint, but want to get the argument
rendered in a readable manner instead.
Constructors
| AsReadable | |
| Fields 
 | |
Instances
| (HasPrettyConfigName config, PrettyReadable a) ⇒ DefaultPrettyBy config (AsReadable a) Source # | |
| Defined in PlutusCore.Pretty.Readable Methods defaultPrettyBy ∷ config → AsReadable a → Doc ann Source # defaultPrettyListBy ∷ config → [AsReadable a] → Doc ann Source # | |
| PrettyDefaultBy config (AsReadable a) ⇒ PrettyBy config (AsReadable a) Source # | |
| Defined in PlutusCore.Pretty.Readable Methods prettyBy ∷ config → AsReadable a → Doc ann Source # prettyListBy ∷ config → [AsReadable a] → Doc ann Source # | |
| PrettyReadable a ⇒ Show (AsReadable a) Source # | |
| Defined in PlutusCore.Pretty.Readable | |
| PrettyReadable a ⇒ Pretty (AsReadable a) Source # | |
| Defined in PlutusCore.Pretty.Readable | |
A value of type a to render in parens using the readable pretty-printer.
Constructors
| Parened | |
| Fields 
 | |
Instances
| PrettyReadableBy configName a ⇒ PrettyBy (PrettyConfigReadable configName) (Parened a) Source # | |
| Defined in PlutusCore.Pretty.Readable Methods prettyBy ∷ PrettyConfigReadable configName → Parened a → Doc ann Source # prettyListBy ∷ PrettyConfigReadable configName → [Parened a] → Doc ann Source # | |
inBraces ∷ a → Parened a Source #
Enclose the given value, so that it's rendered inside of braces with no additional parens
 regardless of the RenderContext.
topPrettyConfigReadable ∷ configName → ShowKinds → PrettyConfigReadable configName Source #
A PrettyConfigReadable with the fixity specified to topFixity.
botPrettyConfigReadable ∷ configName → ShowKinds → PrettyConfigReadable configName Source #
A PrettyConfigReadable with the fixity specified to botFixity.
binderFixity ∷ Fixity Source #
The fixity of a binder.
The fixity of (->).
iterTyForallPrettyM ∷ (MonadPrettyReadable configName env m, PrettyReadableBy configName arg, PrettyReadableBy configName body) ⇒ [arg] → body → m (Doc ann) Source #
Lay out an iterated TyForall via iterBinderPrettyM.
iterLamAbsPrettyM ∷ (MonadPrettyReadable configName env m, PrettyReadableBy configName arg, PrettyReadableBy configName body) ⇒ [arg] → body → m (Doc ann) Source #
Lay out an iterated LamAbs via iterBinderPrettyM.
iterTyAbsPrettyM ∷ (MonadPrettyReadable configName env m, PrettyReadableBy configName arg, PrettyReadableBy configName body) ⇒ [arg] → body → m (Doc ann) Source #
Lay out an iterated TyAbs via iterBinderPrettyM.
iterArrowPrettyM ∷ (MonadPrettyReadable configName env m, PrettyReadableBy configName a) ⇒ [a] → a → m (Doc ann) Source #
Lay out an iterated ->.
iterAppDocM ∷ MonadPrettyContext config env m ⇒ (AnyToDoc config ann → AnyToDoc config ann → NonEmpty (Doc ann)) → m (Doc ann) Source #
Lay out an iteration application, providing to the caller a function to render the head of the application and a function to render each of the arguments.
iterInterAppPrettyM ∷ (MonadPrettyReadable configName env m, PrettyReadableBy configName fun, PrettyReadableBy configName ty, PrettyReadableBy configName term) ⇒ fun → [Either ty term] → m (Doc ann) Source #
iterAppPrettyM ∷ (MonadPrettyContext config env m, PrettyBy config fun, PrettyBy config term) ⇒ fun → [term] → m (Doc ann) Source #
Lay out iterated function applications either as
foo x y z
or as
foo x y z
Utils
prettyBytes ∷ ByteString → Doc ann Source #
newtype ConstConfig Source #
The type of configs used for pretty-printing constants. Has a RenderContext inside, so that
 we don't add redundant parens to the output.
Constructors
| ConstConfig | |
| Fields | |
Instances
type PrettyConst = PrettyBy ConstConfig Source #
type PrettyUni uni = (PrettyParens (SomeTypeIn uni), Closed uni, uni `Everywhere` PrettyConst) Source #
The set of constraints we need to be able to print built-in types and their values.
type ThrowableBuiltins uni fun = (PrettyUni uni, Pretty fun, Typeable uni, Typeable fun) Source #
The set of constraints we need to be able to throw exceptions with things with built-in types and functions in them.
prettyConst ∷ PrettyConst a ⇒ RenderContext → a → Doc ann Source #
module Text.PrettyBy.Fixity