Moduleplutus-core-1.70.0.0
PlutusCore.Pretty
- 36 types
- 6 classes
- 61 values
- Packageplutus-core-1.70.0.0
- Exports103
- LicenceApache-2.0
- SourceFixity.hs
A fixity with the lowest precedence. When used as a part of an outer context, never causes addition of parens.
An initial RenderContext. An expression printed in this context never gets enclosed in parens.
The fixity of juxtaposition.
A fixity with the highest precedence. When used as a part of an outer context, always causes addition of parens.
An initial RenderContext. An expression printed in this context always gets enclosed in parens.
The fixity of a unitary expression which is safe to render without parens in any context.
encloseIn :: Ord prec=> (a -> a)Enclose a value of type
ain parens.-> RenderContextOver precAn outer context.
-> FixityOver precAn inner fixity.
-> a-> a
Enclose an a (using the provided function) if required or leave it as is.
The need for enclosing is determined from an outer RenderContext and the inner fixity.
Pretty-print and render a value as a string type.
Pretty-print and render a value as a string type in a configurable way.
Enclose a Doc in parentheses if required or leave it as is. The need for enclosing is determined from an outer RenderContext (stored in the environment of the monad) and the inner fixity provided as an argument.
Takes a monadic pretty-printer and turns it into one that receives a config explicitly.
Useful for defining instances of PrettyBy monadically when writing precedence-aware
pretty-printing code (and since all functions below are monadic, it's currenty the only option).
Instantiate a supplied continuation with two pretty-printers (one is going in the ToTheLeft direction, the other is in the ToTheRight direction) specialized to supplied Fixity and apply encloseM, specialized to the same fixity, to the result. The idea is that to the outside an infix operator has the same inner fixity as it has the outer fixity to inner subexpressions.
Pretty-print two things with a space between them. The fixity of the context in which the arguments get pretty-printed is set to juxtFixity.
Run InContextM by supplying a config.
Call encloseM on unitFixity.
Instantiate a supplied continuation with a precedence-aware pretty-printer.
Pretty-print and render a value as a string type in a configurable way in a monad holding a config.
Pretty-print a value in a configurable way in a monad holding a config.
Constructors
PrettyConfigClassic_pccConfigName :: configName_pccDisplayAnn :: Bool
Instances10Show, HasPrettyConfigName, PrettyBy, HasPrettyDefaults, …
Show configName => Show (PrettyConfigClassic configName)Defined in plutus-core-1.70.0.0 · PlutusCore.Pretty.ClassicconfigName ~ PrettyConfigName => HasPrettyConfigName (PrettyConfigClassic configName)Defined in plutus-core-1.70.0.0 · PlutusCore.Pretty.ClassicPretty ann => PrettyBy (PrettyConfigClassic configName) (Kind ann)Defined in plutus-core-1.70.0.0 · PlutusCore.Core.Instance.Pretty.Classic · orphan(PrettyClassicBy configName tyname, PrettyParens (SomeTypeIn uni), Pretty ann) => PrettyBy (PrettyConfigClassic configName) (Type tyname uni ann)Defined in plutus-core-1.70.0.0 · PlutusCore.Core.Instance.Pretty.Classic · orphan(PrettyClassic name, PrettyUni uni, Pretty fun, Pretty ann) => PrettyBy (PrettyConfigClassic PrettyConfigName) (UnrestrictedProgram name uni fun ann)Defined in plutus-core-1.70.0.0 · UntypedPlutusCore.Core.Instance.Flat(PrettyClassicBy configName (Term name uni fun ann), Pretty ann) => PrettyBy (PrettyConfigClassic configName) (Program name uni fun ann)Defined in plutus-core-1.70.0.0 · UntypedPlutusCore.Core.Instance.Pretty.Classic · orphan(PrettyClassicBy configName name, PrettyUni uni, Pretty fun, Pretty ann) => PrettyBy (PrettyConfigClassic configName) (Term name uni fun ann)Defined in plutus-core-1.70.0.0 · UntypedPlutusCore.Core.Instance.Pretty.Classic · orphan(PrettyClassicBy configName (Term tyname name uni fun ann), Pretty ann) => PrettyBy (PrettyConfigClassic configName) (Program tyname name uni fun ann)Defined in plutus-core-1.70.0.0 · PlutusCore.Core.Instance.Pretty.Classic · orphan(PrettyClassicBy configName tyname, PrettyClassicBy configName name, PrettyUni uni, Pretty fun, Pretty ann) => PrettyBy (PrettyConfigClassic configName) (Term tyname name uni fun ann)Defined in plutus-core-1.70.0.0 · PlutusCore.Core.Instance.Pretty.Classic · orphantype HasPrettyDefaults (PrettyConfigClassic _1) = 'TrueDefined in plutus-core-1.70.0.0 · PlutusCore.Pretty.Classic
Methods
toPrettyConfigName :: config -> PrettyConfigName
Instances5HasPrettyConfigName
HasPrettyConfigName PrettyConfigPlcDefined in plutus-core-1.70.0.0 · PlutusCore.Pretty.PlcHasPrettyConfigName PrettyConfigPlcStrategyDefined in plutus-core-1.70.0.0 · PlutusCore.Pretty.PlcHasPrettyConfigName (Sole PrettyConfigName)Defined in plutus-core-1.70.0.0 · PlutusCore.Pretty.ConfigNameconfigName ~ PrettyConfigName => HasPrettyConfigName (PrettyConfigClassic configName)Defined in plutus-core-1.70.0.0 · PlutusCore.Pretty.ClassicconfigName ~ PrettyConfigName => HasPrettyConfigName (PrettyConfigReadable configName)Defined in plutus-core-1.70.0.0 · PlutusCore.Pretty.Readable
Constructors
Instances6Eq, Show, HasPrettyConfigName, PrettyBy, HasPrettyDefaults
Eq PrettyConfigNameDefined in plutus-core-1.70.0.0 · PlutusCore.Pretty.ConfigNameShow PrettyConfigNameDefined in plutus-core-1.70.0.0 · PlutusCore.Pretty.ConfigNameHasPrettyConfigName (Sole PrettyConfigName)Defined in plutus-core-1.70.0.0 · PlutusCore.Pretty.ConfigName(PrettyClassic name, PrettyUni uni, Pretty fun, Pretty ann) => PrettyBy (PrettyConfigClassic PrettyConfigName) (UnrestrictedProgram name uni fun ann)Defined in plutus-core-1.70.0.0 · UntypedPlutusCore.Core.Instance.Flat(PrettyReadable name, PrettyUni uni, Pretty fun) => PrettyBy (PrettyConfigReadable PrettyConfigName) (UnrestrictedProgram name uni fun ann)Defined in plutus-core-1.70.0.0 · UntypedPlutusCore.Core.Instance.Flattype HasPrettyDefaults PrettyConfigName = 'TrueDefined in plutus-core-1.70.0.0 · PlutusCore.Pretty.ConfigName
Instances2Eq, Show
Eq CondensedErrorsDefined in plutus-core-1.70.0.0 · PlutusCore.Pretty.PlcShow CondensedErrorsDefined in plutus-core-1.70.0.0 · PlutusCore.Pretty.Plc
Instances18Show, HasPrettyConfigName, PrettyBy, HasPrettyDefaults, …
Show PrettyConfigPlcDefined in plutus-core-1.70.0.0 · PlutusCore.Pretty.PlcHasPrettyConfigName PrettyConfigPlcDefined in plutus-core-1.70.0.0 · PlutusCore.Pretty.PlcPrettyBy PrettyConfigPlc DefaultFunDefined in plutus-core-1.70.0.0 · PlutusCore.Default.BuiltinsDefaultPrettyPlcStrategy (Kind ann) => PrettyBy PrettyConfigPlc (Kind ann)Defined in plutus-core-1.70.0.0 · PlutusCore.Core.Instance.Pretty.Plc · orphanDefaultPrettyPlcStrategy a => PrettyBy PrettyConfigPlc (PrettyAny a)Defined in plutus-core-1.70.0.0 · PlutusCore.Pretty.PlcPrettyBy PrettyConfigPlc a => PrettyBy PrettyConfigPlc (ExpectedShapeOr a)Defined in plutus-core-1.70.0.0 · PlutusCore.Error(PrettyUni uni, Pretty fun) => PrettyBy PrettyConfigPlc (CkValue uni fun)Defined in plutus-core-1.70.0.0 · PlutusCore.Evaluation.Machine.Ck(PrettyUni uni, Pretty fun) => PrettyBy PrettyConfigPlc (DischargeResult uni fun)Defined in plutus-core-1.70.0.0 · UntypedPlutusCore.Evaluation.Machine.Cek.InternalDefaultPrettyPlcStrategy (Type tyname uni ann) => PrettyBy PrettyConfigPlc (Type tyname uni ann)Defined in plutus-core-1.70.0.0 · PlutusCore.Core.Instance.Pretty.Plc · orphan(PrettyUni uni, Pretty fun) => PrettyBy PrettyConfigPlc (CekValue uni fun ann)Defined in plutus-core-1.70.0.0 · UntypedPlutusCore.Evaluation.Machine.Cek.Internal(PrettyUni uni, Pretty fun, Pretty ann) => PrettyBy PrettyConfigPlc (Error uni fun ann)Defined in plutus-core-1.70.0.0 · PlutusCore.ErrorDefaultPrettyPlcStrategy (UnrestrictedProgram name uni fun ann) => PrettyBy PrettyConfigPlc (UnrestrictedProgram name uni fun ann)Defined in plutus-core-1.70.0.0 · UntypedPlutusCore.Core.Instance.FlatDefaultPrettyPlcStrategy (Program name uni fun ann) => PrettyBy PrettyConfigPlc (Program name uni fun ann)Defined in plutus-core-1.70.0.0 · UntypedPlutusCore.Core.Instance.Pretty.Plc · orphanDefaultPrettyPlcStrategy (Term name uni fun ann) => PrettyBy PrettyConfigPlc (Term name uni fun ann)Defined in plutus-core-1.70.0.0 · UntypedPlutusCore.Core.Instance.Pretty.Plc · orphan(Pretty term, PrettyUni uni, Pretty fun, Pretty ann) => PrettyBy PrettyConfigPlc (TypeError term uni fun ann)Defined in plutus-core-1.70.0.0 · PlutusCore.ErrorDefaultPrettyPlcStrategy (Program tyname name uni fun ann) => PrettyBy PrettyConfigPlc (Program tyname name uni fun ann)Defined in plutus-core-1.70.0.0 · PlutusCore.Core.Instance.Pretty.Plc · orphanDefaultPrettyPlcStrategy (Term tyname name uni fun ann) => PrettyBy PrettyConfigPlc (Term tyname name uni fun ann)Defined in plutus-core-1.70.0.0 · PlutusCore.Core.Instance.Pretty.Plc · orphantype HasPrettyDefaults PrettyConfigPlc = 'TrueDefined in plutus-core-1.70.0.0 · PlutusCore.Pretty.Plc
Constructors
Instances1Show
Show PrettyConfigPlcOptionsDefined in plutus-core-1.70.0.0 · PlutusCore.Pretty.Plc
Instances3Show, HasPrettyConfigName, PrettyBy
Show PrettyConfigPlcStrategyDefined in plutus-core-1.70.0.0 · PlutusCore.Pretty.PlcHasPrettyConfigName PrettyConfigPlcStrategyDefined in plutus-core-1.70.0.0 · PlutusCore.Pretty.PlcDefaultPrettyPlcStrategy a => PrettyBy PrettyConfigPlcStrategy (PrettyAny a)Defined in plutus-core-1.70.0.0 · PlutusCore.Pretty.Plc
Constructors
Instances25HasRenderContext, DefaultPrettyBy, NonDefaultPrettyBy, PrettyBy, HasPrettyDefaults, …
HasRenderContext ConstConfigDefined in plutus-core-1.70.0.0 · PlutusCore.Pretty.PrettyConstNonDefaultPrettyBy ConstConfig IntegerDefined in plutus-core-1.70.0.0 · PlutusCore.Pretty.PrettyConstNonDefaultPrettyBy ConstConfig BoolDefined in plutus-core-1.70.0.0 · PlutusCore.Pretty.PrettyConstNonDefaultPrettyBy ConstConfig TextDefined in plutus-core-1.70.0.0 · PlutusCore.Pretty.PrettyConstNonDefaultPrettyBy ConstConfig ()Defined in plutus-core-1.70.0.0 · PlutusCore.Pretty.PrettyConstPrettyBy ConstConfig ByteStringDefined in plutus-core-1.70.0.0 · PlutusCore.Pretty.PrettyConstPrettyBy ConstConfig ElementDefined in plutus-core-1.70.0.0 · PlutusCore.Crypto.BLS12_381.G1PrettyBy ConstConfig ElementDefined in plutus-core-1.70.0.0 · PlutusCore.Crypto.BLS12_381.G2PrettyBy ConstConfig MlResultDefined in plutus-core-1.70.0.0 · PlutusCore.Crypto.BLS12_381.PairingPrettyBy ConstConfig DataDefined in plutus-core-1.70.0.0 · PlutusCore.Pretty.PrettyConstPrettyBy ConstConfig CByteStringDefined in plutus-core-1.70.0.0 · PlutusCore.Default.Universe.CardanoPrettyBy ConstConfig CIntegerDefined in plutus-core-1.70.0.0 · PlutusCore.Default.Universe.CardanoPrettyBy ConstConfig KDefined in plutus-core-1.70.0.0 · PlutusCore.Pretty.PrettyConstPrettyBy ConstConfig QuantityDefined in plutus-core-1.70.0.0 · PlutusCore.Pretty.PrettyConstPrettyBy ConstConfig ValueDefined in plutus-core-1.70.0.0 · PlutusCore.Pretty.PrettyConstPrettyConst a => NonDefaultPrettyBy ConstConfig (Vector a)Defined in plutus-core-1.70.0.0 · PlutusCore.Pretty.PrettyConstPrettyConst a => NonDefaultPrettyBy ConstConfig [a]Defined in plutus-core-1.70.0.0 · PlutusCore.Pretty.PrettyConstDefaultPrettyBy ConstConfig (PrettyAny a) => NonDefaultPrettyBy ConstConfig (PrettyAny a)Defined in plutus-core-1.70.0.0 · PlutusCore.Pretty.PrettyConstPrettyConst a => PrettyBy ConstConfig (NoParens a)Defined in plutus-core-1.70.0.0 · PlutusCore.Pretty.PrettyConstDefaultPrettyBy ConstConfig (PrettyAny a) => PrettyBy ConstConfig (PrettyAny a)Defined in plutus-core-1.70.0.0 · PlutusCore.Pretty.PrettyConstShow a => DefaultPrettyBy ConstConfig (PrettyAny a)Defined in plutus-core-1.70.0.0 · PlutusCore.Pretty.PrettyConst(PrettyConst a, PrettyConst b) => NonDefaultPrettyBy ConstConfig (a, b)Defined in plutus-core-1.70.0.0 · PlutusCore.Pretty.PrettyConst(Closed uni, Everywhere uni PrettyConst) => PrettyBy ConstConfig (ValueOf uni a)Defined in plutus-core-1.70.0.0 · PlutusCore.Pretty.PrettyConst(Closed uni, Everywhere uni PrettyConst) => PrettyBy ConstConfig (Some (ValueOf uni))Defined in plutus-core-1.70.0.0 · PlutusCore.Pretty.PrettyConsttype HasPrettyDefaults ConstConfig = 'FalseDefined in plutus-core-1.70.0.0 · PlutusCore.Pretty.PrettyConst
type PrettyUni (uni :: Type -> Type) = (PrettyParens (SomeTypeIn uni), Closed uni, Everywhere uni PrettyConst)Constructors
Instances4PrettyBy, DefaultPrettyBy, Show, Pretty
PrettyDefaultBy config (AsReadable a) => PrettyBy config (AsReadable a)Defined in plutus-core-1.70.0.0 · PlutusCore.Pretty.Readable(HasPrettyConfigName config, PrettyReadable a) => DefaultPrettyBy config (AsReadable a)Defined in plutus-core-1.70.0.0 · PlutusCore.Pretty.ReadablePrettyReadable a => Show (AsReadable a)Defined in plutus-core-1.70.0.0 · PlutusCore.Pretty.ReadablePrettyReadable a => Pretty (AsReadable a)Defined in plutus-core-1.70.0.0 · PlutusCore.Pretty.Readable
Constructors
Instances1PrettyBy
PrettyReadableBy configName a => PrettyBy (PrettyConfigReadable configName) (Parened a)Defined in plutus-core-1.70.0.0 · PlutusCore.Pretty.Readable
Constructors
PrettyConfigReadable_pcrConfigName :: configName_pcrRenderContext :: RenderContext_pcrShowKinds :: ShowKinds
Instances14Show, HasRenderContext, HasPrettyConfigName, PrettyBy, HasPrettyDefaults, …
Show configName => Show (PrettyConfigReadable configName)Defined in plutus-core-1.70.0.0 · PlutusCore.Pretty.ReadableHasRenderContext (PrettyConfigReadable configName)Defined in plutus-core-1.70.0.0 · PlutusCore.Pretty.ReadableconfigName ~ PrettyConfigName => HasPrettyConfigName (PrettyConfigReadable configName)Defined in plutus-core-1.70.0.0 · PlutusCore.Pretty.ReadablePrettyReadableBy configName a => PrettyBy (PrettyConfigReadable configName) (Parened a)Defined in plutus-core-1.70.0.0 · PlutusCore.Pretty.ReadablePrettyBy (PrettyConfigReadable configName) (Kind a)Defined in plutus-core-1.70.0.0 · PlutusCore.Core.Instance.Pretty.Readable · orphanPrettyReadableBy configName tyname => PrettyBy (PrettyConfigReadable configName) (TyVarDecl tyname ann)Defined in plutus-core-1.70.0.0 · PlutusCore.Core.Instance.Pretty.Readable · orphan(PrettyReadableBy configName tyname, PrettyParens (SomeTypeIn uni)) => PrettyBy (PrettyConfigReadable configName) (Type tyname uni a)Defined in plutus-core-1.70.0.0 · PlutusCore.Core.Instance.Pretty.Readable · orphanPrettyReadableBy configName (Term name uni fun a) => PrettyBy (PrettyConfigReadable configName) (Program name uni fun a)Defined in plutus-core-1.70.0.0 · UntypedPlutusCore.Core.Instance.Pretty.Readable · orphan(PrettyReadable name, PrettyUni uni, Pretty fun) => PrettyBy (PrettyConfigReadable PrettyConfigName) (UnrestrictedProgram name uni fun ann)Defined in plutus-core-1.70.0.0 · UntypedPlutusCore.Core.Instance.Flat(PrettyReadableBy configName name, PrettyUni uni, Pretty fun, Show configName) => PrettyBy (PrettyConfigReadable configName) (Term name uni fun a)Defined in plutus-core-1.70.0.0 · UntypedPlutusCore.Core.Instance.Pretty.Readable · orphan(PrettyReadableBy configName tyname, PrettyReadableBy configName name, PrettyUni uni) => PrettyBy (PrettyConfigReadable configName) (VarDecl tyname name uni ann)Defined in plutus-core-1.70.0.0 · PlutusCore.Core.Instance.Pretty.Readable · orphanPrettyReadableBy configName (Term tyname name uni fun a) => PrettyBy (PrettyConfigReadable configName) (Program tyname name uni fun a)Defined in plutus-core-1.70.0.0 · PlutusCore.Core.Instance.Pretty.Readable · orphan(PrettyReadableBy configName tyname, PrettyReadableBy configName name, PrettyUni uni, Pretty fun) => PrettyBy (PrettyConfigReadable configName) (Term tyname name uni fun a)Defined in plutus-core-1.70.0.0 · PlutusCore.Core.Instance.Pretty.Readable · orphantype HasPrettyDefaults (PrettyConfigReadable _1) = 'TrueDefined in plutus-core-1.70.0.0 · PlutusCore.Pretty.Readable
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
Instances9Functor, PrettyAnn, Show, IsString, Generic, Semigroup, …
Functor DocDefined in prettyprinter-1.7.2 · 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.PrettyAnn ann (Doc ann)Defined in prettyprinter-1.7.2 · Prettyprinter.InternalShow (Doc ann)Defined in prettyprinter-1.7.2 · Prettyprinter.Internal(show doc)prettyprints documentdocwith defaultLayoutOptions, ignoring all annotations.IsString (Doc ann)Defined in prettyprinter-1.7.2 · Prettyprinter.InternalGeneric (Doc ann)Defined in prettyprinter-1.7.2 · Prettyprinter.InternalSemigroup (Doc ann)Defined in prettyprinter-1.7.2 · Prettyprinter.InternalMonoid (Doc ann)Defined in prettyprinter-1.7.2 · Prettyprinter.Internalann ~ Void => Pretty (Doc ann)Defined in prettyprinter-1.7.2 · Prettyprinter.Internaltype Rep (Doc ann) = D1 ('MetaDataDefined in prettyprinter-1.7.2 · Prettyprinter.Internal"Doc"
"Prettyprinter.Internal"
"prettyprinter-1.7.2-AnRtQTyRihFBuoLoc5CL1J"
'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)))))))
Methods
pretty :: a -> Doc annExample1 expression pretty 1 <+> pretty "hello" <+> pretty 1.2341 hello 1.234
prettyList :: [a] -> Doc annprettyListis only used to define theinstance Pretty a => Pretty [a]. In normal circumstances only theprettyfunction is used.Example1 expression prettyList [1, 23, 456][1, 23, 456]
Instances101Pretty, …
Pretty VoidDefined in prettyprinter-1.7.2 · Prettyprinter.InternalFinding a good example for printing something that does not exist is hard, so here is an example of printing a list full of nothing.
Example1 expression pretty ([] :: [Void])[]
Pretty IntegerDefined in prettyprinter-1.7.2 · Prettyprinter.InternalExample1 expression pretty (2^123 :: Integer)10633823966279326983230456482242756608
Pretty NaturalDefined in prettyprinter-1.7.2 · Prettyprinter.InternalPretty Int16Defined in prettyprinter-1.7.2 · Prettyprinter.InternalPretty Int32Defined in prettyprinter-1.7.2 · Prettyprinter.InternalPretty Int64Defined in prettyprinter-1.7.2 · Prettyprinter.InternalPretty Int8Defined in prettyprinter-1.7.2 · Prettyprinter.InternalPretty BoolDefined in prettyprinter-1.7.2 · Prettyprinter.InternalExample1 expression pretty TrueTrue
Pretty CharDefined in prettyprinter-1.7.2 · Prettyprinter.InternalPretty DoubleDefined in prettyprinter-1.7.2 · Prettyprinter.InternalExample1 expression pretty (exp 1 :: Double)2.71828182845904...
Pretty FloatDefined in prettyprinter-1.7.2 · Prettyprinter.InternalExample1 expression pretty (pi :: Float)3.1415927
Pretty IntDefined in prettyprinter-1.7.2 · Prettyprinter.InternalExample1 expression pretty (123 :: Int)123
Pretty WordDefined in prettyprinter-1.7.2 · Prettyprinter.InternalPretty Word16Defined in prettyprinter-1.7.2 · Prettyprinter.InternalPretty Word32Defined in prettyprinter-1.7.2 · Prettyprinter.InternalPretty Word64Defined in prettyprinter-1.7.2 · Prettyprinter.InternalPretty Word8Defined in prettyprinter-1.7.2 · Prettyprinter.InternalPretty SourcePosDefined in plutus-core-1.70.0.0 · PlutusCore.Error · orphanPretty DeserialiseFailureInfoDefined in plutus-core-1.70.0.0 · Codec.Extras.SerialiseViaFlatPretty DeserialiseFailureReasonDefined in plutus-core-1.70.0.0 · Codec.Extras.SerialiseViaFlatPretty AnnDefined in plutus-core-1.70.0.0 · PlutusCore.AnnotationPretty SrcSpanDefined in plutus-core-1.70.0.0 · PlutusCore.AnnotationPretty SrcSpansDefined in plutus-core-1.70.0.0 · PlutusCore.AnnotationPretty ParamDefined in plutus-core-1.70.0.0 · PlutusCore.ArityPretty AstSizeDefined in plutus-core-1.70.0.0 · PlutusCore.AstSizePretty BuiltinErrorDefined in plutus-core-1.70.0.0 · PlutusCore.Builtin.ResultPretty UnliftingErrorDefined in plutus-core-1.70.0.0 · PlutusCore.Builtin.ResultPretty UnliftingEvaluationErrorDefined in plutus-core-1.70.0.0 · PlutusCore.Builtin.ResultPretty NameAnnDefined in plutus-core-1.70.0.0 · PlutusCore.Check.ScopingPretty ScopeErrorDefined in plutus-core-1.70.0.0 · PlutusCore.Check.ScopingPretty ElementDefined in plutus-core-1.70.0.0 · PlutusCore.Crypto.BLS12_381.G1Pretty ElementDefined in plutus-core-1.70.0.0 · PlutusCore.Crypto.BLS12_381.G2Pretty MlResultDefined in plutus-core-1.70.0.0 · PlutusCore.Crypto.BLS12_381.PairingPretty DataDefined in plutus-core-1.70.0.0 · PlutusCore.DataPretty FreeVariableErrorDefined in plutus-core-1.70.0.0 · PlutusCore.DeBruijn.InternalPretty IndexDefined in plutus-core-1.70.0.0 · PlutusCore.DeBruijn.InternalPretty DefaultFunDefined in plutus-core-1.70.0.0 · PlutusCore.Default.BuiltinsPretty ParserErrorDefined in plutus-core-1.70.0.0 · PlutusCore.ErrorPretty ParserErrorBundleDefined in plutus-core-1.70.0.0 · PlutusCore.ErrorPretty CkUserErrorDefined in plutus-core-1.70.0.0 · PlutusCore.Evaluation.Machine.CkPretty CostModelApplyErrorDefined in plutus-core-1.70.0.0 · PlutusCore.Evaluation.Machine.CostModelInterfacePretty CostModelApplyWarnDefined in plutus-core-1.70.0.0 · PlutusCore.Evaluation.Machine.CostModelInterfacePretty ExBudgetDefined in plutus-core-1.70.0.0 · PlutusCore.Evaluation.Machine.ExBudgetPretty ExRestrictingBudgetDefined in plutus-core-1.70.0.0 · PlutusCore.Evaluation.Machine.ExBudgetPretty ExCPUDefined in plutus-core-1.70.0.0 · PlutusCore.Evaluation.Machine.ExMemoryPretty ExMemoryDefined in plutus-core-1.70.0.0 · PlutusCore.Evaluation.Machine.ExMemoryPretty ExtensionFunDefined in plutus-core-1.70.0.0 · PlutusCore.Examples.BuiltinsPretty NameDefined in plutus-core-1.70.0.0 · PlutusCore.Core.Instance.Pretty.Default · orphanPretty TyNameDefined in plutus-core-1.70.0.0 · PlutusCore.Core.Instance.Pretty.Default · orphanPretty UniqueDefined in plutus-core-1.70.0.0 · PlutusCore.Name.UniquePretty QuantityDefined in plutus-core-1.70.0.0 · PlutusCore.ValuePretty ValueDefined in plutus-core-1.70.0.0 · PlutusCore.ValuePretty VersionDefined in plutus-core-1.70.0.0 · PlutusCore.VersionPretty CountingStDefined in plutus-core-1.70.0.0 · UntypedPlutusCore.Evaluation.Machine.Cek.ExBudgetModePretty RestrictingStDefined in plutus-core-1.70.0.0 · UntypedPlutusCore.Evaluation.Machine.Cek.ExBudgetModePretty CekUserErrorDefined in plutus-core-1.70.0.0 · UntypedPlutusCore.Evaluation.Machine.Cek.InternalPretty CseWhichSubtermsDefined in plutus-core-1.70.0.0 · UntypedPlutusCore.Optimize.OptsPretty PurityDefined in plutus-core-1.70.0.0 · UntypedPlutusCore.PurityPretty WorkFreedomDefined in plutus-core-1.70.0.0 · UntypedPlutusCore.PurityPretty TextDefined in prettyprinter-1.7.2 · Prettyprinter.InternalPretty TextDefined in prettyprinter-1.7.2 · Prettyprinter.Internal(lazy Text instance, identical to the strict version)
Pretty ()Defined in prettyprinter-1.7.2 · Prettyprinter.InternalExample1 expression pretty ()()
The argument is not used:
Example1 expression pretty (error "Strict?" :: ())()
Show fun => Pretty (ExBudgetCategory fun)Defined in plutus-core-1.70.0.0 · UntypedPlutusCore.Evaluation.Machine.Cek.InternalPrettyClassic a => Pretty (EvaluationResult a)Defined in plutus-core-1.70.0.0 · PlutusCore.Evaluation.ResultPrettyReadable a => Pretty (AsReadable a)Defined in plutus-core-1.70.0.0 · PlutusCore.Pretty.ReadablePretty (BuiltinSemanticsVariant DefaultFun)Defined in plutus-core-1.70.0.0 · PlutusCore.Default.BuiltinsPretty (DefaultUni a)Defined in plutus-core-1.70.0.0 · PlutusCore.Default.UniversePretty (SomeTypeIn DefaultUni)Defined in plutus-core-1.70.0.0 · PlutusCore.Default.UniversePretty (SomeTypeIn uni) => Pretty (SomeTypeIn (Kinded uni))Defined in plutus-core-1.70.0.0 · PlutusCore.Pretty.PrettyConst · orphanPretty a => Pretty (NonEmpty a)Defined in prettyprinter-1.7.2 · Prettyprinter.InternalPretty a => Pretty (Identity a)Defined in prettyprinter-1.7.2 · Prettyprinter.InternalExample1 expression pretty (Identity 1)1
Pretty a => Pretty (Maybe a)Defined in prettyprinter-1.7.2 · Prettyprinter.InternalPretty a => Pretty (Spine a)Defined in plutus-core-1.70.0.0 · PlutusCore.Builtin.KnownTypePretty a => Pretty (Normalized a)Defined in plutus-core-1.70.0.0 · PlutusCore.Core.TypePretty a => Pretty [a]Defined in prettyprinter-1.7.2 · Prettyprinter.InternalExample1 expression pretty [1,2,3][1, 2, 3]
Pretty ann => Pretty (Kind ann)Defined in plutus-core-1.70.0.0 · PlutusCore.Core.Instance.Pretty.Default · orphanPretty ann => Pretty (UniqueError ann)Defined in plutus-core-1.70.0.0 · PlutusCore.Error(Show fun, Ord fun) => Pretty (CekExTally fun)Defined in plutus-core-1.70.0.0 · UntypedPlutusCore.Evaluation.Machine.Cek.ExBudgetMode(Show fun, Ord fun) => Pretty (TallyingSt fun)Defined in plutus-core-1.70.0.0 · UntypedPlutusCore.Evaluation.Machine.Cek.ExBudgetModeann ~ Void => Pretty (Doc ann)Defined in prettyprinter-1.7.2 · Prettyprinter.InternalDefaultPrettyBy config a => Pretty (AttachDefaultPrettyConfig config a)Defined in prettyprinter-configurable-1.36.0.0 · Text.PrettyBy.InternalPrettyBy config a => Pretty (AttachPrettyConfig config a)Defined in prettyprinter-configurable-1.36.0.0 · Text.PrettyBy.InternalExample4 expressions data Cfg = Cfgdata D = Dinstance PrettyBy Cfg D where prettyBy Cfg D = "D"pretty $ AttachPrettyConfig Cfg DD
(Closed uni, Everywhere uni PrettyConst) => Pretty (ValueOf uni a)Defined in plutus-core-1.70.0.0 · PlutusCore.Pretty.PrettyConst · orphan(Closed uni, Everywhere uni PrettyConst) => Pretty (Some (ValueOf uni))Defined in plutus-core-1.70.0.0 · PlutusCore.Pretty.PrettyConst · orphan(Pretty a, Pretty b) => Pretty (Either a b)Defined in plutus-core-1.70.0.0 · PlutusPrelude · orphan(Pretty a1, Pretty a2) => Pretty (a1, a2)Defined in prettyprinter-1.7.2 · Prettyprinter.InternalExample1 expression pretty (123, "hello")(123, hello)
(Pretty err, Pretty cause) => Pretty (ErrorWithCause err cause)Defined in plutus-core-1.70.0.0 · PlutusCore.Evaluation.ErrorWithCause(Pretty structural, Pretty operational) => Pretty (EvaluationError structural operational)Defined in plutus-core-1.70.0.0 · PlutusCore.Evaluation.ErrorPretty (CekState uni fun ann)Defined in plutus-core-1.70.0.0 · UntypedPlutusCore.Evaluation.Machine.SteppableCek.InternalPretty a => Pretty (Const a b)Defined in prettyprinter-1.7.2 · Prettyprinter.Internal(PrettyClassic tyname, PrettyParens (SomeTypeIn uni), Pretty ann) => Pretty (Type tyname uni ann)Defined in plutus-core-1.70.0.0 · PlutusCore.Core.Instance.Pretty.Default · orphan(Pretty a1, Pretty a2, Pretty a3) => Pretty (a1, a2, a3)Defined in prettyprinter-1.7.2 · Prettyprinter.InternalExample1 expression pretty (123, "hello", False)(123, hello, False)
(Pretty err, Pretty a, Pretty b) => Pretty (HeadSpine err a b)Defined in plutus-core-1.70.0.0 · PlutusCore.Builtin.KnownType(PrettyClassic name, PrettyUni uni, Pretty fun, Pretty ann) => Pretty (Program name uni fun ann)Defined in plutus-core-1.70.0.0 · UntypedPlutusCore.Core.Instance.Pretty.Default · orphan(PrettyClassic name, PrettyUni uni, Pretty fun, Pretty ann) => Pretty (Term name uni fun ann)Defined in plutus-core-1.70.0.0 · UntypedPlutusCore.Core.Instance.Pretty.Default · orphan(Pretty a1, Pretty a2, Pretty a3, Pretty a4) => Pretty (a1, a2, a3, a4)Defined in prettyprinter-1.7.2 · Prettyprinter.InternalExample1 expression pretty (123, "hello", False, ())(123, hello, False, ())
(PrettyClassic tyname, PrettyClassic name, PrettyUni uni, Pretty fun, Pretty ann) => Pretty (Program tyname name uni fun ann)Defined in plutus-core-1.70.0.0 · PlutusCore.Core.Instance.Pretty.Default · orphan(PrettyClassic tyname, PrettyClassic name, PrettyUni uni, Pretty fun, Pretty ann) => Pretty (Term tyname name uni fun ann)Defined in plutus-core-1.70.0.0 · PlutusCore.Core.Instance.Pretty.Default · orphan(Pretty a1, Pretty a2, Pretty a3, Pretty a4, Pretty a5) => Pretty (a1, a2, a3, a4, a5)Defined in prettyprinter-1.7.2 · Prettyprinter.InternalExample1 expression pretty (123, "hello", False, (), 3.14)(123, hello, False, (), 3.14)
(Pretty a1, Pretty a2, Pretty a3, Pretty a4, Pretty a5, Pretty a6) => Pretty (a1, a2, a3, a4, a5, a6)Defined in prettyprinter-1.7.2 · Prettyprinter.InternalExample1 expression pretty (123, "hello", False, (), 3.14, Just 2.71)(123, hello, False, (), 3.14, 2.71)
(Pretty a1, Pretty a2, Pretty a3, Pretty a4, Pretty a5, Pretty a6, Pretty a7) => Pretty (a1, a2, a3, a4, a5, a6, a7)Defined in prettyprinter-1.7.2 · Prettyprinter.InternalExample1 expression pretty (123, "hello", False, (), 3.14, Just 2.71, [1,2,3])(123, hello, False, (), 3.14, 2.71, [1, 2, 3])
FixityOver instantiated at Precedence.
Fractional precedence, so that it's always possible to squeeze an operator precedence between
two existing precedences. Ranges over [-20, 120]. A normal operator should have a precedence
within [0, 100). It might be useful to have a negative precedence if you're trying to model
some already existing system, for example in Haskell ($) has precedence 0, but clearly
if b then y else f $ x should be rendered without any parens, hence the precedence of
if_then_else_ is less than 0, i.e. negative.
The precedence of juxtaposition is 100. Normally you want juxtaposition to have the highest
precedence, but some languages have operators that bind tighter than juxtaposition, e.g.
Haskell's postfix _{_}: f z { x = y } means f (z {x = y}).
FixityOver instantiated at Precedence.
Instances2PrettyBy
PrettyBy RenderContext (DefaultUni a)Defined in plutus-core-1.70.0.0 · PlutusCore.Default.UniversePrettyBy RenderContext (SomeTypeIn DefaultUni)Defined in plutus-core-1.70.0.0 · PlutusCore.Default.Universe
Associativity of an operator.
Instances2Eq, Show
Eq AssociativityDefined in prettyprinter-configurable-1.36.0.0 · Text.Fixity.InternalShow AssociativityDefined in prettyprinter-configurable-1.36.0.0 · Text.Fixity.Internal
Direction in which pretty-printing goes. For example in x + y x is pretty-printed to the
left of + and y is pretty-printed to the right of +.
Fixity of an operator.
We allow unary operators to have associativity, because it's useful to distinguish
between an expression like -(-x) (unary minus, left-associative) and ~~b
(boolean NOT, right-associative).
Associativity of unary operators also matters when pretty-printing expressions like (-x) + y,
which is pretty-printed as -x + y, assuming unary minus has the same fixity as + (and both
the operators are left-associative). I.e. unary minus is handled just like the binary one:
(0 - x) + y is pretty-printed as 0 - x + y.
Postfix operators are handled similarly. E.g. if ! is left-associative, then (x!)! is
pretty-printed as x!! and if it's right-associative -- (x!)!.
The data type is parameterized, so that the user can choose precedence to be integer/fractional,
bounded/unbounded, etc (we could also allows operators to be partially or totally ordered, but
at the moment prec is required to implement Ord, i.e. it has to be totally ordered).
By default we go with bounded fractional precedence, see the main Text.Fixity module.
Constructors
Fixity_fixityAssociativity :: !Associativity_fixityPrecedence :: !prec
Instances2Eq, Show
Eq prec => Eq (FixityOver prec)Defined in prettyprinter-configurable-1.36.0.0 · Text.Fixity.InternalShow prec => Show (FixityOver prec)Defined in prettyprinter-configurable-1.36.0.0 · Text.Fixity.Internal
A context that an expression is being rendered in.
Constructors
Instances3HasRenderContext, Eq, Show
HasRenderContext RenderContextDefined in prettyprinter-configurable-1.36.0.0 · Text.PrettyBy.FixityEq prec => Eq (RenderContextOver prec)Defined in prettyprinter-configurable-1.36.0.0 · Text.Fixity.InternalShow prec => Show (RenderContextOver prec)Defined in prettyprinter-configurable-1.36.0.0 · Text.Fixity.Internal
A class for rendering Docs as string types.
The type of a general config-based pretty-printer.
A constraint for "RenderContext is a part of config".
Methods
renderContext :: Lens' config RenderContext
Instances3HasRenderContext
HasRenderContext ConstConfigDefined in plutus-core-1.70.0.0 · PlutusCore.Pretty.PrettyConstHasRenderContext RenderContextDefined in prettyprinter-configurable-1.36.0.0 · Text.PrettyBy.FixityHasRenderContext (PrettyConfigReadable configName)Defined in plutus-core-1.70.0.0 · PlutusCore.Pretty.Readable
A monad for precedence-aware pretty-printing.
Constructors
InContextMunInContextM :: Reader (Sole config) a
Instances6Profunctor, Monad, Functor, Applicative, MonadReader, IsString
Profunctor InContextMDefined in plutus-core-1.70.0.0 · PlutusCore.Pretty.Extra · orphanMonad (InContextM config)Defined in prettyprinter-configurable-1.36.0.0 · Text.PrettyBy.FixityFunctor (InContextM config)Defined in prettyprinter-configurable-1.36.0.0 · Text.PrettyBy.FixityApplicative (InContextM config)Defined in prettyprinter-configurable-1.36.0.0 · Text.PrettyBy.FixityMonadReader (Sole config) (InContextM config)Defined in prettyprinter-configurable-1.36.0.0 · Text.PrettyBy.Fixity(HasRenderContext config, doc ~ Doc ann) => IsString (InContextM config doc)Defined in prettyprinter-configurable-1.36.0.0 · Text.PrettyBy.FixityA string written in the InContextM monad gets enclosed with unitDocM automatically.
type MonadPrettyContext config env (m :: Type -> Type) = (MonadPretty config env m, HasRenderContext config)A constraint for "m is a Monad supporting configurable precedence-aware pretty-printing".
A newtype wrapper around a introduced for its HasPrettyConfig instance.
Instances4HasPrettyConfigName, HasPrettyConfig, MonadReader, HasPrettyDefaults
HasPrettyConfigName (Sole PrettyConfigName)Defined in plutus-core-1.70.0.0 · PlutusCore.Pretty.ConfigNameHasPrettyConfig (Sole config) configDefined in prettyprinter-configurable-1.36.0.0 · Text.PrettyBy.FixityIt's not possible to have
HasPrettyConfig config config, because that would mean that every environment is a pretty-printing config on its own, which doesn't make sense. We could have an OVERLAPPABLE instance, but I'd rather not.MonadReader (Sole config) (InContextM config)Defined in prettyprinter-configurable-1.36.0.0 · Text.PrettyBy.Fixitytype HasPrettyDefaults (Sole config) = HasPrettyDefaults configDefined in plutus-core-1.70.0.0 · PlutusCore.Pretty.Extra · orphan
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
Instances1Pretty
PrettyBy config a => Pretty (AttachPrettyConfig config a)Defined in prettyprinter-configurable-1.36.0.0 · Text.PrettyBy.InternalExample4 expressions data Cfg = Cfgdata D = Dinstance PrettyBy Cfg D where prettyBy Cfg D = "D"pretty $ AttachPrettyConfig Cfg DD
A newtype wrapper around a whose point is to provide a PrettyBy config instance
for anything that has a Pretty instance.
Constructors
Instances1PrettyBy
Pretty a => PrettyBy config (IgnorePrettyConfig a)Defined in prettyprinter-configurable-1.36.0.0 · Text.PrettyBy.InternalExample4 expressions data Cfg = Cfgdata D = Dinstance Pretty D where pretty D = "D"prettyBy Cfg $ IgnorePrettyConfig DD
A class for pretty-printing values in a configurable manner.
A basic example:
data Case = UpperCase | LowerCasedata D = Dinstance PrettyBy Case D where prettyBy UpperCase D = "D"; prettyBy LowerCase D = "d"prettyBy UpperCase DDprettyBy 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 = ViaShowinstance 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.
Methods
prettyBy :: config -> a -> Doc annPretty-print a value of type
athe way aconfigspecifies 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":Example3 expressions newtype N = N Int deriving newtype (Pretty)instance PrettyBy () NprettyBy () (N 42)42
The default implementation of prettyBy for a Functor is going to be in terms of defaultPrettyFunctorBy:
Example3 expressions 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:Example3 expressions 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:
Example3 expressions 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 kindTypeand 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 kindType, 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 annprettyListBy is used to define the default PrettyBy instance for
[a]andNonEmpty a. In normal circumstances only the prettyBy function is used. The default implementation of prettyListBy is in terms of defaultPrettyFunctorBy.
Instances110PrettyBy, …
HasPrettyConfigName config => PrettyBy config DeBruijnDefined in plutus-core-1.70.0.0 · PlutusCore.DeBruijn.InternalHasPrettyConfigName config => PrettyBy config FakeNamedDeBruijnDefined in plutus-core-1.70.0.0 · PlutusCore.DeBruijn.InternalHasPrettyConfigName config => PrettyBy config NamedDeBruijnDefined in plutus-core-1.70.0.0 · PlutusCore.DeBruijn.InternalHasPrettyConfigName config => PrettyBy config NamedTyDeBruijnDefined in plutus-core-1.70.0.0 · PlutusCore.DeBruijn.InternalHasPrettyConfigName config => PrettyBy config TyDeBruijnDefined in plutus-core-1.70.0.0 · PlutusCore.DeBruijn.InternalHasPrettyConfigName config => PrettyBy config NameDefined in plutus-core-1.70.0.0 · PlutusCore.Name.UniqueHasPrettyConfigName config => PrettyBy config TyNameDefined in plutus-core-1.70.0.0 · PlutusCore.Name.UniquePrettyBy PrettyConfigPlc DefaultFunDefined in plutus-core-1.70.0.0 · PlutusCore.Default.BuiltinsPrettyBy ConstConfig ByteStringDefined in plutus-core-1.70.0.0 · PlutusCore.Pretty.PrettyConstPrettyBy ConstConfig ElementDefined in plutus-core-1.70.0.0 · PlutusCore.Crypto.BLS12_381.G1PrettyBy ConstConfig ElementDefined in plutus-core-1.70.0.0 · PlutusCore.Crypto.BLS12_381.G2PrettyBy ConstConfig MlResultDefined in plutus-core-1.70.0.0 · PlutusCore.Crypto.BLS12_381.PairingPrettyBy ConstConfig DataDefined in plutus-core-1.70.0.0 · PlutusCore.Pretty.PrettyConstPrettyBy ConstConfig CByteStringDefined in plutus-core-1.70.0.0 · PlutusCore.Default.Universe.CardanoPrettyBy ConstConfig CIntegerDefined in plutus-core-1.70.0.0 · PlutusCore.Default.Universe.CardanoPrettyBy ConstConfig KDefined in plutus-core-1.70.0.0 · PlutusCore.Pretty.PrettyConstPrettyBy ConstConfig QuantityDefined in plutus-core-1.70.0.0 · PlutusCore.Pretty.PrettyConstPrettyBy ConstConfig ValueDefined in plutus-core-1.70.0.0 · PlutusCore.Pretty.PrettyConstPrettyBy config AstSizeDefined in plutus-core-1.70.0.0 · PlutusCore.AstSizePrettyBy config ExBudgetDefined in plutus-core-1.70.0.0 · PlutusCore.Evaluation.Machine.ExBudgetPrettyBy config ExRestrictingBudgetDefined in plutus-core-1.70.0.0 · PlutusCore.Evaluation.Machine.ExBudgetPrettyBy config ExCPUDefined in plutus-core-1.70.0.0 · PlutusCore.Evaluation.Machine.ExMemoryPrettyBy config ExMemoryDefined in plutus-core-1.70.0.0 · PlutusCore.Evaluation.Machine.ExMemoryPrettyBy config CountingStDefined in plutus-core-1.70.0.0 · UntypedPlutusCore.Evaluation.Machine.Cek.ExBudgetModePrettyBy config RestrictingStDefined in plutus-core-1.70.0.0 · UntypedPlutusCore.Evaluation.Machine.Cek.ExBudgetModePrettyDefaultBy config Void => PrettyBy config VoidDefined in prettyprinter-configurable-1.36.0.0 · Text.PrettyBy.InternalExample1 expression prettyBy () ([] :: [Void])[]
PrettyDefaultBy config Integer => PrettyBy config IntegerDefined in prettyprinter-configurable-1.36.0.0 · Text.PrettyBy.InternalExample1 expression prettyBy () (2^(123 :: Int) :: Integer)10633823966279326983230456482242756608
PrettyDefaultBy config Natural => PrettyBy config NaturalDefined in prettyprinter-configurable-1.36.0.0 · Text.PrettyBy.InternalExample1 expression prettyBy () (123 :: Natural)123
PrettyDefaultBy config Int16 => PrettyBy config Int16Defined in prettyprinter-configurable-1.36.0.0 · Text.PrettyBy.InternalPrettyDefaultBy config Int32 => PrettyBy config Int32Defined in prettyprinter-configurable-1.36.0.0 · Text.PrettyBy.InternalPrettyDefaultBy config Int64 => PrettyBy config Int64Defined in prettyprinter-configurable-1.36.0.0 · Text.PrettyBy.InternalPrettyDefaultBy config Int8 => PrettyBy config Int8Defined in prettyprinter-configurable-1.36.0.0 · Text.PrettyBy.InternalPrettyDefaultBy config Bool => PrettyBy config BoolDefined in prettyprinter-configurable-1.36.0.0 · Text.PrettyBy.InternalExample1 expression prettyBy () TrueTrue
PrettyDefaultBy config Char => PrettyBy config CharDefined in prettyprinter-configurable-1.36.0.0 · Text.PrettyBy.InternalBy default a String (i.e.
[Char]) is converted to aTextfirst and then pretty-printed. So make sure that if you have any non-default pretty-printing forCharorText, they're in sync.Example2 expressions prettyBy () 'a'aprettyBy () "abc"abc
PrettyDefaultBy config Double => PrettyBy config DoubleDefined in prettyprinter-configurable-1.36.0.0 · Text.PrettyBy.InternalExample1 expression prettyBy () (pi :: Double)3.141592653589793
PrettyDefaultBy config Float => PrettyBy config FloatDefined in prettyprinter-configurable-1.36.0.0 · Text.PrettyBy.InternalExample1 expression prettyBy () (pi :: Float)3.1415927
PrettyDefaultBy config Int => PrettyBy config IntDefined in prettyprinter-configurable-1.36.0.0 · Text.PrettyBy.InternalExample1 expression prettyBy () (123 :: Int)123
PrettyDefaultBy config Word => PrettyBy config WordDefined in prettyprinter-configurable-1.36.0.0 · Text.PrettyBy.InternalPrettyDefaultBy config Word16 => PrettyBy config Word16Defined in prettyprinter-configurable-1.36.0.0 · Text.PrettyBy.InternalPrettyDefaultBy config Word32 => PrettyBy config Word32Defined in prettyprinter-configurable-1.36.0.0 · Text.PrettyBy.InternalPrettyDefaultBy config Word64 => PrettyBy config Word64Defined in prettyprinter-configurable-1.36.0.0 · Text.PrettyBy.InternalPrettyDefaultBy config Word8 => PrettyBy config Word8Defined in prettyprinter-configurable-1.36.0.0 · Text.PrettyBy.InternalPrettyDefaultBy config Text => PrettyBy config TextDefined in prettyprinter-configurable-1.36.0.0 · Text.PrettyBy.InternalAutomatically converts all newlines to
line.Example1 expression prettyBy () ("hello\nworld" :: Strict.Text)helloworld
PrettyDefaultBy config Text => PrettyBy config TextDefined in prettyprinter-configurable-1.36.0.0 · Text.PrettyBy.InternalAn instance for lazy
Text. Identitical to the strict one.PrettyDefaultBy config () => PrettyBy config ()Defined in prettyprinter-configurable-1.36.0.0 · Text.PrettyBy.InternalExample1 expression prettyBy () ()()
The argument is not used:
Example1 expression prettyBy () (error "Strict?" :: ())()
DefaultPrettyPlcStrategy (Kind ann) => PrettyBy PrettyConfigPlc (Kind ann)Defined in plutus-core-1.70.0.0 · PlutusCore.Core.Instance.Pretty.Plc · orphanDefaultPrettyPlcStrategy a => PrettyBy PrettyConfigPlc (PrettyAny a)Defined in plutus-core-1.70.0.0 · PlutusCore.Pretty.PlcDefaultPrettyPlcStrategy a => PrettyBy PrettyConfigPlcStrategy (PrettyAny a)Defined in plutus-core-1.70.0.0 · PlutusCore.Pretty.PlcPrettyConst a => PrettyBy ConstConfig (NoParens a)Defined in plutus-core-1.70.0.0 · PlutusCore.Pretty.PrettyConstPretty a => PrettyBy config (IgnorePrettyConfig a)Defined in prettyprinter-configurable-1.36.0.0 · Text.PrettyBy.InternalExample4 expressions data Cfg = Cfgdata D = Dinstance Pretty D where pretty D = "D"prettyBy Cfg $ IgnorePrettyConfig DD
DefaultPrettyBy ConstConfig (PrettyAny a) => PrettyBy ConstConfig (PrettyAny a)Defined in plutus-core-1.70.0.0 · PlutusCore.Pretty.PrettyConstPrettyBy PrettyConfigPlc a => PrettyBy PrettyConfigPlc (ExpectedShapeOr a)Defined in plutus-core-1.70.0.0 · PlutusCore.ErrorPrettyBy RenderContext (DefaultUni a)Defined in plutus-core-1.70.0.0 · PlutusCore.Default.UniversePrettyBy RenderContext (SomeTypeIn DefaultUni)Defined in plutus-core-1.70.0.0 · PlutusCore.Default.UniversePrettyBy config (t NameAnn) => PrettyBy config (ScopeCheckError t)Defined in plutus-core-1.70.0.0 · PlutusCore.Check.ScopingPrettyBy config a => PrettyBy config (Normalized a)Defined in plutus-core-1.70.0.0 · PlutusCore.Core.TypePrettyBy config a => PrettyBy config (EvaluationResult a)Defined in plutus-core-1.70.0.0 · PlutusCore.Evaluation.ResultPrettyDefaultBy config (Set a) => PrettyBy config (Set a)Defined in plutus-core-1.70.0.0 · PlutusCore.Pretty.Extra · orphanPrettyDefaultBy config (NonEmpty a) => PrettyBy config (NonEmpty a)Defined in prettyprinter-configurable-1.36.0.0 · Text.PrettyBy.InternalprettyBy for
NonEmpty ais defined in terms of prettyListBy by default.Example3 expressions prettyBy () (True :| [False])[True, False]prettyBy () ('a' :| "bc")abcprettyBy () (Just False :| [Nothing, Just True])[False, True]
PrettyDefaultBy config (Identity a) => PrettyBy config (Identity a)Defined in prettyprinter-configurable-1.36.0.0 · Text.PrettyBy.InternalExample1 expression prettyBy () (Identity True)True
PrettyDefaultBy config (Maybe a) => PrettyBy config (Maybe a)Defined in prettyprinter-configurable-1.36.0.0 · Text.PrettyBy.InternalBy default a
[Maybe a]is converted to[a]first and only then pretty-printed.Example4 expressions braces $ prettyBy () (Just True){True}braces $ prettyBy () (Nothing :: Maybe Bool){}prettyBy () [Just False, Nothing, Just True][False, True]prettyBy () [Nothing, Just 'a', Just 'b', Nothing, Just 'c']abc
PrettyDefaultBy config (Spine a) => PrettyBy config (Spine a)Defined in plutus-core-1.70.0.0 · PlutusCore.Builtin.KnownTypePrettyDefaultBy config (AsReadable a) => PrettyBy config (AsReadable a)Defined in plutus-core-1.70.0.0 · PlutusCore.Pretty.ReadablePrettyDefaultBy config (Vector a) => PrettyBy config (Vector a)Defined in plutus-core-1.70.0.0 · PlutusCore.Pretty.Extra · orphanPrettyDefaultBy config [a] => PrettyBy config [a]Defined in prettyprinter-configurable-1.36.0.0 · Text.PrettyBy.InternalprettyBy for
[a]is defined in terms of prettyListBy by default.Example3 expressions prettyBy () [True, False][True, False]prettyBy () "abc"abcprettyBy () [Just False, Nothing, Just True][False, True]
PrettyDefaultBy config a => PrettyBy config (PrettyCommon a)Defined in prettyprinter-configurable-1.36.0.0 · Text.PrettyBy.Internal(Show fun, Ord fun) => PrettyBy config (CekExTally fun)Defined in plutus-core-1.70.0.0 · UntypedPlutusCore.Evaluation.Machine.Cek.ExBudgetMode(Show fun, Ord fun) => PrettyBy config (TallyingSt fun)Defined in plutus-core-1.70.0.0 · UntypedPlutusCore.Evaluation.Machine.Cek.ExBudgetMode(HasPrettyDefaults config ~ 'True, Pretty fun) => PrettyBy config (MachineError fun)Defined in plutus-core-1.70.0.0 · PlutusCore.Evaluation.Machine.ExceptionPrettyDefaultBy config (Map k v) => PrettyBy config (Map k v)Defined in plutus-core-1.70.0.0 · PlutusCore.Pretty.Extra · orphanPrettyDefaultBy config (Either a b) => PrettyBy config (Either a b)Defined in plutus-core-1.70.0.0 · PlutusPrelude · orphanPrettyDefaultBy config (a, b) => PrettyBy config (a, b)Defined in prettyprinter-configurable-1.36.0.0 · Text.PrettyBy.InternalExample1 expression prettyBy () (False, "abc")(False, abc)
(PrettyUni uni, Pretty fun) => PrettyBy PrettyConfigPlc (CkValue uni fun)Defined in plutus-core-1.70.0.0 · PlutusCore.Evaluation.Machine.Ck(PrettyUni uni, Pretty fun) => PrettyBy PrettyConfigPlc (DischargeResult uni fun)Defined in plutus-core-1.70.0.0 · UntypedPlutusCore.Evaluation.Machine.Cek.Internal(Closed uni, Everywhere uni PrettyConst) => PrettyBy ConstConfig (ValueOf uni a)Defined in plutus-core-1.70.0.0 · PlutusCore.Pretty.PrettyConst(Closed uni, Everywhere uni PrettyConst) => PrettyBy ConstConfig (Some (ValueOf uni))Defined in plutus-core-1.70.0.0 · PlutusCore.Pretty.PrettyConst(HasPrettyDefaults config ~ 'True, PrettyBy config structural, Pretty operational) => PrettyBy config (EvaluationError structural operational)Defined in plutus-core-1.70.0.0 · PlutusCore.Evaluation.Error(PrettyBy config cause, PrettyBy config err) => PrettyBy config (ErrorWithCause err cause)Defined in plutus-core-1.70.0.0 · PlutusCore.Evaluation.ErrorWithCauseDefaultPrettyPlcStrategy (Type tyname uni ann) => PrettyBy PrettyConfigPlc (Type tyname uni ann)Defined in plutus-core-1.70.0.0 · PlutusCore.Core.Instance.Pretty.Plc · orphanPrettyDefaultBy config (Const a b) => PrettyBy config (Const a b)Defined in prettyprinter-configurable-1.36.0.0 · Text.PrettyBy.InternalNon-polykinded, because
Pretty (Const a b)is not polykinded either.Example1 expression prettyBy () (Const 1 :: Const Integer Bool)1
PrettyDefaultBy config (HeadSpine err a b) => PrettyBy config (HeadSpine err a b)Defined in plutus-core-1.70.0.0 · PlutusCore.Builtin.KnownTypePrettyDefaultBy config (a, b, c) => PrettyBy config (a, b, c)Defined in prettyprinter-configurable-1.36.0.0 · Text.PrettyBy.InternalExample1 expression prettyBy () ('a', "bcd", True)(a, bcd, True)
(PrettyUni uni, Pretty fun) => PrettyBy PrettyConfigPlc (CekValue uni fun ann)Defined in plutus-core-1.70.0.0 · UntypedPlutusCore.Evaluation.Machine.Cek.Internal(PrettyUni uni, Pretty fun, Pretty ann) => PrettyBy PrettyConfigPlc (Error uni fun ann)Defined in plutus-core-1.70.0.0 · PlutusCore.ErrorDefaultPrettyPlcStrategy (UnrestrictedProgram name uni fun ann) => PrettyBy PrettyConfigPlc (UnrestrictedProgram name uni fun ann)Defined in plutus-core-1.70.0.0 · UntypedPlutusCore.Core.Instance.FlatDefaultPrettyPlcStrategy (Program name uni fun ann) => PrettyBy PrettyConfigPlc (Program name uni fun ann)Defined in plutus-core-1.70.0.0 · UntypedPlutusCore.Core.Instance.Pretty.Plc · orphanDefaultPrettyPlcStrategy (Term name uni fun ann) => PrettyBy PrettyConfigPlc (Term name uni fun ann)Defined in plutus-core-1.70.0.0 · UntypedPlutusCore.Core.Instance.Pretty.Plc · orphanPrettyBy config (Term name uni fun a) => PrettyBy config (EvalOrder name uni fun a)Defined in plutus-core-1.70.0.0 · UntypedPlutusCore.PurityPrettyBy config (Term name uni fun a) => PrettyBy config (EvalTerm name uni fun a)Defined in plutus-core-1.70.0.0 · UntypedPlutusCore.Purity(Pretty term, PrettyUni uni, Pretty fun, Pretty ann) => PrettyBy PrettyConfigPlc (TypeError term uni fun ann)Defined in plutus-core-1.70.0.0 · PlutusCore.ErrorDefaultPrettyPlcStrategy (Program tyname name uni fun ann) => PrettyBy PrettyConfigPlc (Program tyname name uni fun ann)Defined in plutus-core-1.70.0.0 · PlutusCore.Core.Instance.Pretty.Plc · orphanDefaultPrettyPlcStrategy (Term tyname name uni fun ann) => PrettyBy PrettyConfigPlc (Term tyname name uni fun ann)Defined in plutus-core-1.70.0.0 · PlutusCore.Core.Instance.Pretty.Plc · orphan(Pretty ann, PrettyBy config (Type tyname uni ann), PrettyBy config (Term tyname name uni fun ann)) => PrettyBy config (NormCheckError tyname name uni fun ann)Defined in plutus-core-1.70.0.0 · PlutusCore.ErrorPrettyReadableBy configName a => PrettyBy (PrettyConfigReadable configName) (Parened a)Defined in plutus-core-1.70.0.0 · PlutusCore.Pretty.ReadablePretty ann => PrettyBy (PrettyConfigClassic configName) (Kind ann)Defined in plutus-core-1.70.0.0 · PlutusCore.Core.Instance.Pretty.Classic · orphanPrettyBy (PrettyConfigReadable configName) (Kind a)Defined in plutus-core-1.70.0.0 · PlutusCore.Core.Instance.Pretty.Readable · orphanPrettyReadableBy configName tyname => PrettyBy (PrettyConfigReadable configName) (TyVarDecl tyname ann)Defined in plutus-core-1.70.0.0 · PlutusCore.Core.Instance.Pretty.Readable · orphan(PrettyClassicBy configName tyname, PrettyParens (SomeTypeIn uni), Pretty ann) => PrettyBy (PrettyConfigClassic configName) (Type tyname uni ann)Defined in plutus-core-1.70.0.0 · PlutusCore.Core.Instance.Pretty.Classic · orphan(PrettyReadableBy configName tyname, PrettyParens (SomeTypeIn uni)) => PrettyBy (PrettyConfigReadable configName) (Type tyname uni a)Defined in plutus-core-1.70.0.0 · PlutusCore.Core.Instance.Pretty.Readable · orphanPrettyReadableBy configName (Term name uni fun a) => PrettyBy (PrettyConfigReadable configName) (Program name uni fun a)Defined in plutus-core-1.70.0.0 · UntypedPlutusCore.Core.Instance.Pretty.Readable · orphan(PrettyClassic name, PrettyUni uni, Pretty fun, Pretty ann) => PrettyBy (PrettyConfigClassic PrettyConfigName) (UnrestrictedProgram name uni fun ann)Defined in plutus-core-1.70.0.0 · UntypedPlutusCore.Core.Instance.Flat(PrettyClassicBy configName (Term name uni fun ann), Pretty ann) => PrettyBy (PrettyConfigClassic configName) (Program name uni fun ann)Defined in plutus-core-1.70.0.0 · UntypedPlutusCore.Core.Instance.Pretty.Classic · orphan(PrettyClassicBy configName name, PrettyUni uni, Pretty fun, Pretty ann) => PrettyBy (PrettyConfigClassic configName) (Term name uni fun ann)Defined in plutus-core-1.70.0.0 · UntypedPlutusCore.Core.Instance.Pretty.Classic · orphan(PrettyReadable name, PrettyUni uni, Pretty fun) => PrettyBy (PrettyConfigReadable PrettyConfigName) (UnrestrictedProgram name uni fun ann)Defined in plutus-core-1.70.0.0 · UntypedPlutusCore.Core.Instance.Flat(PrettyReadableBy configName name, PrettyUni uni, Pretty fun, Show configName) => PrettyBy (PrettyConfigReadable configName) (Term name uni fun a)Defined in plutus-core-1.70.0.0 · UntypedPlutusCore.Core.Instance.Pretty.Readable · orphan(PrettyReadableBy configName tyname, PrettyReadableBy configName name, PrettyUni uni) => PrettyBy (PrettyConfigReadable configName) (VarDecl tyname name uni ann)Defined in plutus-core-1.70.0.0 · PlutusCore.Core.Instance.Pretty.Readable · orphanPrettyReadableBy configName (Term tyname name uni fun a) => PrettyBy (PrettyConfigReadable configName) (Program tyname name uni fun a)Defined in plutus-core-1.70.0.0 · PlutusCore.Core.Instance.Pretty.Readable · orphan(PrettyClassicBy configName (Term tyname name uni fun ann), Pretty ann) => PrettyBy (PrettyConfigClassic configName) (Program tyname name uni fun ann)Defined in plutus-core-1.70.0.0 · PlutusCore.Core.Instance.Pretty.Classic · orphan(PrettyClassicBy configName tyname, PrettyClassicBy configName name, PrettyUni uni, Pretty fun, Pretty ann) => PrettyBy (PrettyConfigClassic configName) (Term tyname name uni fun ann)Defined in plutus-core-1.70.0.0 · PlutusCore.Core.Instance.Pretty.Classic · orphan(PrettyReadableBy configName tyname, PrettyReadableBy configName name, PrettyUni uni, Pretty fun) => PrettyBy (PrettyConfigReadable configName) (Term tyname name uni fun a)Defined in plutus-core-1.70.0.0 · PlutusCore.Core.Instance.Pretty.Readable · orphan
A constraint for "config is a part of env".
Methods
prettyConfig :: Lens' env config
Instances1HasPrettyConfig
HasPrettyConfig (Sole config) configDefined in prettyprinter-configurable-1.36.0.0 · Text.PrettyBy.FixityIt's not possible to have
HasPrettyConfig config config, because that would mean that every environment is a pretty-printing config on its own, which doesn't make sense. We could have an OVERLAPPABLE instance, but I'd rather not.
type MonadPretty config env (m :: Type -> Type) = (MonadReader env m, HasPrettyConfig env config)A constraint for "m is a monad that allows to pretty-print values in it by a config".