cardano-cli-8.23.1.0: The Cardano command-line interface
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cardano.CLI.Pretty

Synopsis

Documentation

putLnMonadIO m ⇒ Doc AnsiStyle → m () Source #

hPutLnMonadIO m ⇒ HandleDoc AnsiStyle → m () Source #

prettyExceptionException a ⇒ a → Doc ann Source #

Short hand for pretty . displayException

pshowShow a ⇒ a → Doc ann Source #

Short hand for viaShow.

(<+>)Doc ann → Doc ann → Doc ann infixr 6 Source #

(x <+> y) concatenates document x and y with a space in between.

>>> "hello" <+> "world"
hello world
x <+> y = x <> space <> y

hsep ∷ [Doc ann] → Doc ann Source #

(hsep xs) concatenates all documents xs horizontally with <+>, i.e. it puts a space between all entries.

>>> let docs = Util.words "lorem ipsum dolor sit amet"
>>> hsep docs
lorem ipsum dolor sit amet

hsep does not introduce line breaks on its own, even when the page is too narrow:

>>> putDocW 5 (hsep docs)
lorem ipsum dolor sit amet

For automatic line breaks, consider using fillSep instead.

vsep ∷ [Doc ann] → Doc ann Source #

(vsep xs) concatenates all documents xs above each other. If a group undoes the line breaks inserted by vsep, the documents are separated with a space instead.

Using vsep alone yields

>>> "prefix" <+> vsep ["text", "to", "lay", "out"]
prefix text
to
lay
out

grouping a vsep separates the documents with a space if it fits the page (and does nothing otherwise). See the sep convenience function for this use case.

The align function can be used to align the documents under their first element:

>>> "prefix" <+> align (vsep ["text", "to", "lay", "out"])
prefix text
       to
       lay
       out

Since grouping a vsep is rather common, sep is a built-in for doing that.

class Monad m ⇒ MonadIO (m ∷ TypeType) where Source #

Monads in which IO computations may be embedded. Any monad built by applying a sequence of monad transformers to the IO monad will be an instance of this class.

Instances should satisfy the following laws, which state that liftIO is a transformer of monads:

Methods

liftIOIO a → m a Source #

Lift a computation from the IO monad. This allows us to run IO computations in any monadic stack, so long as it supports these kinds of operations (i.e. IO is the base monad for the stack).

Example

Expand
import Control.Monad.Trans.State -- from the "transformers" library

printState :: Show s => StateT s IO ()
printState = do
  state <- get
  liftIO $ print state

Had we omitted liftIO, we would have ended up with this error:

• Couldn't match type ‘IO’ with ‘StateT s IO’
 Expected type: StateT s IO ()
   Actual type: IO ()

The important part here is the mismatch between StateT s IO () and IO ().

Luckily, we know of a function that takes an IO a and returns an (m a): liftIO, enabling us to run the program and see the expected results:

> evalStateT printState "hello"
"hello"

> evalStateT printState 3
3

Instances

Instances details
MonadIO IO

Since: base-4.9.0.0

Instance details

Defined in Control.Monad.IO.Class

Methods

liftIOIO a → IO a Source #

MonadIO Q 
Instance details

Defined in Language.Haskell.TH.Syntax

Methods

liftIOIO a → Q a Source #

MonadIO m ⇒ MonadIO (WarningIO m) Source # 
Instance details

Defined in Cardano.CLI.Types.MonadWarning

Methods

liftIOIO a → WarningIO m a Source #

MonadIO m ⇒ MonadIO (IdentityT m) 
Instance details

Defined in Foundation.Monad.Identity

Methods

liftIOIO a → IdentityT m a Source #

MonadIO m ⇒ MonadIO (GenT m) 
Instance details

Defined in Hedgehog.Internal.Gen

Methods

liftIOIO a → GenT m a Source #

MonadIO m ⇒ MonadIO (PropertyT m) 
Instance details

Defined in Hedgehog.Internal.Property

Methods

liftIOIO a → PropertyT m a Source #

MonadIO m ⇒ MonadIO (TestT m) 
Instance details

Defined in Hedgehog.Internal.Property

Methods

liftIOIO a → TestT m a Source #

MonadIO m ⇒ MonadIO (TreeT m) 
Instance details

Defined in Hedgehog.Internal.Tree

Methods

liftIOIO a → TreeT m a Source #

MonadIO m ⇒ MonadIO (ListT m) 
Instance details

Defined in ListT

Methods

liftIOIO a → ListT m a Source #

MonadIO m ⇒ MonadIO (ResourceT m) 
Instance details

Defined in Control.Monad.Trans.Resource.Internal

Methods

liftIOIO a → ResourceT m a Source #

MonadIO m ⇒ MonadIO (ListT m) 
Instance details

Defined in Control.Monad.Trans.List

Methods

liftIOIO a → ListT m a Source #

MonadIO m ⇒ MonadIO (MaybeT m) 
Instance details

Defined in Control.Monad.Trans.Maybe

Methods

liftIOIO a → MaybeT m a Source #

MonadIO m ⇒ MonadIO (RandT g m) 
Instance details

Defined in Control.Monad.Trans.Random.Lazy

Methods

liftIOIO a → RandT g m a Source #

MonadIO m ⇒ MonadIO (RandT g m) 
Instance details

Defined in Control.Monad.Trans.Random.Strict

Methods

liftIOIO a → RandT g m a Source #

(Functor m, MonadIO m) ⇒ MonadIO (StateT s m) 
Instance details

Defined in Foundation.Monad.State

Methods

liftIOIO a → StateT s m a Source #

(Functor f, MonadIO m) ⇒ MonadIO (FreeT f m) 
Instance details

Defined in Control.Monad.Trans.Free

Methods

liftIOIO a → FreeT f m a Source #

(Error e, MonadIO m) ⇒ MonadIO (ErrorT e m) 
Instance details

Defined in Control.Monad.Trans.Error

Methods

liftIOIO a → ErrorT e m a Source #

MonadIO m ⇒ MonadIO (ExceptT e m) 
Instance details

Defined in Control.Monad.Trans.Except

Methods

liftIOIO a → ExceptT e m a Source #

MonadIO m ⇒ MonadIO (IdentityT m) 
Instance details

Defined in Control.Monad.Trans.Identity

Methods

liftIOIO a → IdentityT m a Source #

MonadIO m ⇒ MonadIO (ReaderT r m) 
Instance details

Defined in Control.Monad.Trans.Reader

Methods

liftIOIO a → ReaderT r m a Source #

MonadIO m ⇒ MonadIO (StateT s m) 
Instance details

Defined in Control.Monad.Trans.State.Lazy

Methods

liftIOIO a → StateT s m a Source #

MonadIO m ⇒ MonadIO (StateT s m) 
Instance details

Defined in Control.Monad.Trans.State.Strict

Methods

liftIOIO a → StateT s m a Source #

(Monoid w, MonadIO m) ⇒ MonadIO (WriterT w m) 
Instance details

Defined in Control.Monad.Trans.Writer.Lazy

Methods

liftIOIO a → WriterT w m a Source #

(Monoid w, MonadIO m) ⇒ MonadIO (WriterT w m) 
Instance details

Defined in Control.Monad.Trans.Writer.Strict

Methods

liftIOIO a → WriterT w m a Source #

MonadIO m ⇒ MonadIO (ConduitT i o m) 
Instance details

Defined in Data.Conduit.Internal.Conduit

Methods

liftIOIO a → ConduitT i o m a Source #

MonadIO m ⇒ MonadIO (ParsecT s u m) 
Instance details

Defined in Text.Parsec.Prim

Methods

liftIOIO a → ParsecT s u m a Source #

MonadIO m ⇒ MonadIO (ContT r m) 
Instance details

Defined in Control.Monad.Trans.Cont

Methods

liftIOIO a → ContT r m a Source #

(Monoid w, MonadIO m) ⇒ MonadIO (RWST r w s m) 
Instance details

Defined in Control.Monad.Trans.RWS.Lazy

Methods

liftIOIO a → RWST r w s m a Source #

(Monoid w, MonadIO m) ⇒ MonadIO (RWST r w s m) 
Instance details

Defined in Control.Monad.Trans.RWS.Strict

Methods

liftIOIO a → RWST r w s m a Source #

MonadIO m ⇒ MonadIO (LocalStateQueryExpr block point query r m) 
Instance details

Defined in Cardano.Api.IPC.Monad

Methods

liftIOIO a → LocalStateQueryExpr block point query r m a Source #

MonadIO m ⇒ MonadIO (Pipe l i o u m) 
Instance details

Defined in Data.Conduit.Internal.Pipe

Methods

liftIOIO a → Pipe l i o u m a Source #

type Ann = AnsiStyle Source #

Ann is the prettyprinter annotation for cardano-api and cardano-cli to enable the printing of colored output. This is a type alias for AnsiStyle.

newtype ShowOf a Source #

Constructors

ShowOf a 

Instances

Instances details
Show a ⇒ ToJSON (ShowOf a) 
Instance details

Defined in Cardano.Api.Via.ShowOf

Show a ⇒ ToJSONKey (ShowOf a) 
Instance details

Defined in Cardano.Api.Via.ShowOf

Show a ⇒ Show (ShowOf a) 
Instance details

Defined in Cardano.Api.Via.ShowOf

Methods

showsPrecIntShowOf a → ShowS Source #

showShowOf a → String Source #

showList ∷ [ShowOf a] → ShowS Source #

Show a ⇒ Pretty (ShowOf a) 
Instance details

Defined in Cardano.Api.Via.ShowOf

Methods

prettyShowOf a → Doc ann Source #

prettyList ∷ [ShowOf a] → Doc ann Source #

data Doc ann Source #

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"]))
hello
world

Instances

Instances details
Functor Doc

Alter the document’s annotations.

This instance makes Doc more flexible (because it can be used in Functor-polymorphic values), but fmap is much less readable compared to using reAnnotate in code that only works for Doc anyway. Consider using the latter when the type does not matter.

Instance details

Defined in Prettyprinter.Internal

Methods

fmap ∷ (a → b) → Doc a → Doc b Source #

(<$) ∷ a → Doc b → Doc a Source #

IsString (Doc ann)
>>> pretty ("hello\nworld")
hello
world

This instance uses the Pretty Doc instance, and uses the same newline to line conversion.

Instance details

Defined in Prettyprinter.Internal

Methods

fromStringStringDoc ann Source #

Monoid (Doc ann)
mempty = emptyDoc
mconcat = hcat
>>> mappend "hello" "world" :: Doc ann
helloworld
Instance details

Defined in Prettyprinter.Internal

Methods

memptyDoc ann Source #

mappendDoc ann → Doc ann → Doc ann Source #

mconcat ∷ [Doc ann] → Doc ann Source #

Semigroup (Doc ann)
x <> y = hcat [x, y]
>>> "hello" <> "world" :: Doc ann
helloworld
Instance details

Defined in Prettyprinter.Internal

Methods

(<>)Doc ann → Doc ann → Doc ann Source #

sconcatNonEmpty (Doc ann) → Doc ann Source #

stimesIntegral b ⇒ b → Doc ann → Doc ann Source #

Generic (Doc ann) 
Instance details

Defined in Prettyprinter.Internal

Associated Types

type Rep (Doc ann) ∷ TypeType Source #

Methods

fromDoc ann → Rep (Doc ann) x Source #

toRep (Doc ann) x → Doc ann Source #

Show (Doc ann)

(show doc) prettyprints document doc with defaultLayoutOptions, ignoring all annotations.

Instance details

Defined in Prettyprinter.Internal

Methods

showsPrecIntDoc ann → ShowS Source #

showDoc ann → String Source #

showList ∷ [Doc ann] → ShowS Source #

CanAnnotate (Chunk Doc) 
Instance details

Defined in Options.Applicative.Help.Chunk

Methods

annTraceIntStringChunk DocChunk Doc Source #

CanAnnotate (Doc Ann) 
Instance details

Defined in Options.Applicative.Help.Ann

Methods

annTraceIntStringDoc AnnDoc Ann Source #

type Rep (Doc ann) 
Instance details

Defined in Prettyprinter.Internal

type Rep (Doc ann) = D1 ('MetaData "Doc" "Prettyprinter.Internal" "prettyprinter-1.7.1-566e5d4946e451e1b3a1377ccf0f615abc1808b2c8cd5c5b32f319217b7b7dba" 'False) (((C1 ('MetaCons "Fail" 'PrefixI 'False) (U1TypeType) :+: (C1 ('MetaCons "Empty" 'PrefixI 'False) (U1TypeType) :+: C1 ('MetaCons "Char" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Char)))) :+: (C1 ('MetaCons "Text" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Int) :*: S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text)) :+: (C1 ('MetaCons "Line" 'PrefixI 'False) (U1TypeType) :+: C1 ('MetaCons "FlatAlt" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Doc ann)) :*: S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Doc ann)))))) :+: ((C1 ('MetaCons "Cat" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Doc ann)) :*: S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Doc ann))) :+: (C1 ('MetaCons "Nest" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Int) :*: S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Doc ann))) :+: C1 ('MetaCons "Union" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Doc ann)) :*: S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Doc ann))))) :+: ((C1 ('MetaCons "Column" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (IntDoc ann))) :+: C1 ('MetaCons "WithPageWidth" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (PageWidthDoc ann)))) :+: (C1 ('MetaCons "Nesting" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (IntDoc ann))) :+: C1 ('MetaCons "Annotated" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ann) :*: S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Doc ann)))))))

class Pretty a where Source #

Overloaded conversion to Doc.

Laws:

  1. output should be pretty. :-)

Minimal complete definition

pretty

Methods

pretty ∷ a → Doc ann Source #

>>> pretty 1 <+> pretty "hello" <+> pretty 1.234
1 hello 1.234

prettyList ∷ [a] → Doc ann Source #

prettyList is only used to define the instance Pretty a => Pretty [a]. In normal circumstances only the pretty function is used.

>>> prettyList [1, 23, 456]
[1, 23, 456]

Instances

Instances details
Pretty Void

Finding a good example for printing something that does not exist is hard, so here is an example of printing a list full of nothing.

>>> pretty ([] :: [Void])
[]
Instance details

Defined in Prettyprinter.Internal

Methods

prettyVoidDoc ann Source #

prettyList ∷ [Void] → Doc ann Source #

Pretty Int16 
Instance details

Defined in Prettyprinter.Internal

Methods

prettyInt16Doc ann Source #

prettyList ∷ [Int16] → Doc ann Source #

Pretty Int32 
Instance details

Defined in Prettyprinter.Internal

Methods

prettyInt32Doc ann Source #

prettyList ∷ [Int32] → Doc ann Source #

Pretty Int64 
Instance details

Defined in Prettyprinter.Internal

Methods

prettyInt64Doc ann Source #

prettyList ∷ [Int64] → Doc ann Source #

Pretty Int8 
Instance details

Defined in Prettyprinter.Internal

Methods

prettyInt8Doc ann Source #

prettyList ∷ [Int8] → Doc ann Source #

Pretty Word16 
Instance details

Defined in Prettyprinter.Internal

Methods

prettyWord16Doc ann Source #

prettyList ∷ [Word16] → Doc ann Source #

Pretty Word32 
Instance details

Defined in Prettyprinter.Internal

Methods

prettyWord32Doc ann Source #

prettyList ∷ [Word32] → Doc ann Source #

Pretty Word64 
Instance details

Defined in Prettyprinter.Internal

Methods

prettyWord64Doc ann Source #

prettyList ∷ [Word64] → Doc ann Source #

Pretty Word8 
Instance details

Defined in Prettyprinter.Internal

Methods

prettyWord8Doc ann Source #

prettyList ∷ [Word8] → Doc ann Source #

Pretty AnyCardanoEra 
Instance details

Defined in Cardano.Api.Eras.Core

Pretty TxOutInAnyEra 
Instance details

Defined in Cardano.Api.Tx.Body

Pretty TxIn 
Instance details

Defined in Cardano.Api.TxIn

Methods

prettyTxInDoc ann Source #

prettyList ∷ [TxIn] → Doc ann Source #

Pretty Ann 
Instance details

Defined in PlutusCore.Annotation

Methods

prettyAnnDoc ann Source #

prettyList ∷ [Ann] → Doc ann Source #

Pretty SrcSpan 
Instance details

Defined in PlutusCore.Annotation

Methods

prettySrcSpanDoc ann Source #

prettyList ∷ [SrcSpan] → Doc ann Source #

Pretty SrcSpans 
Instance details

Defined in PlutusCore.Annotation

Methods

prettySrcSpansDoc ann Source #

prettyList ∷ [SrcSpans] → Doc ann Source #

Pretty BuiltinError 
Instance details

Defined in PlutusCore.Builtin.Result

Methods

prettyBuiltinErrorDoc ann Source #

prettyList ∷ [BuiltinError] → Doc ann Source #

Pretty UnliftingError 
Instance details

Defined in PlutusCore.Builtin.Result

Pretty Data 
Instance details

Defined in PlutusCore.Data

Methods

prettyDataDoc ann Source #

prettyList ∷ [Data] → Doc ann Source #

Pretty FreeVariableError 
Instance details

Defined in PlutusCore.DeBruijn.Internal

Pretty Index 
Instance details

Defined in PlutusCore.DeBruijn.Internal

Methods

prettyIndexDoc ann Source #

prettyList ∷ [Index] → Doc ann Source #

Pretty DefaultFun 
Instance details

Defined in PlutusCore.Default.Builtins

Methods

prettyDefaultFunDoc ann Source #

prettyList ∷ [DefaultFun] → Doc ann Source #

Pretty ParserError 
Instance details

Defined in PlutusCore.Error

Methods

prettyParserErrorDoc ann Source #

prettyList ∷ [ParserError] → Doc ann Source #

Pretty ParserErrorBundle 
Instance details

Defined in PlutusCore.Error

Pretty CkUserError 
Instance details

Defined in PlutusCore.Evaluation.Machine.Ck

Methods

pretty ∷ CkUserError → Doc ann Source #

prettyList ∷ [CkUserError] → Doc ann Source #

Pretty CostModelApplyError 
Instance details

Defined in PlutusCore.Evaluation.Machine.CostModelInterface

Pretty CostModelApplyWarn 
Instance details

Defined in PlutusCore.Evaluation.Machine.CostModelInterface

Pretty ExBudget 
Instance details

Defined in PlutusCore.Evaluation.Machine.ExBudget

Methods

prettyExBudgetDoc ann Source #

prettyList ∷ [ExBudget] → Doc ann Source #

Pretty ExRestrictingBudget 
Instance details

Defined in PlutusCore.Evaluation.Machine.ExBudget

Pretty ExCPU 
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemory

Methods

prettyExCPUDoc ann Source #

prettyList ∷ [ExCPU] → Doc ann Source #

Pretty ExMemory 
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemory

Methods

prettyExMemoryDoc ann Source #

prettyList ∷ [ExMemory] → Doc ann Source #

Pretty Unique 
Instance details

Defined in PlutusCore.Name.Unique

Methods

prettyUniqueDoc ann Source #

prettyList ∷ [Unique] → Doc ann Source #

Pretty Version 
Instance details

Defined in PlutusCore.Version

Methods

prettyVersionDoc ann Source #

prettyList ∷ [Version] → Doc ann Source #

Pretty CountingSt 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.ExBudgetMode

Methods

prettyCountingStDoc ann Source #

prettyList ∷ [CountingSt] → Doc ann Source #

Pretty RestrictingSt 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.ExBudgetMode

Pretty CekUserError 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

Methods

prettyCekUserErrorDoc ann Source #

prettyList ∷ [CekUserError] → Doc ann Source #

Pretty DatatypeComponent 
Instance details

Defined in PlutusIR.Compiler.Provenance

Pretty GeneratedKind 
Instance details

Defined in PlutusIR.Compiler.Provenance

Pretty EvaluationError 
Instance details

Defined in PlutusLedgerApi.Common.Eval

Pretty MajorProtocolVersion 
Instance details

Defined in PlutusLedgerApi.Common.ProtocolVersions

Pretty ScriptDecodeError 
Instance details

Defined in PlutusLedgerApi.Common.SerialisedScript

Pretty PlutusLedgerLanguage 
Instance details

Defined in PlutusLedgerApi.Common.Versions

Pretty Address 
Instance details

Defined in PlutusLedgerApi.V1.Address

Methods

prettyAddressDoc ann Source #

prettyList ∷ [Address] → Doc ann Source #

Pretty LedgerBytes 
Instance details

Defined in PlutusLedgerApi.V1.Bytes

Methods

prettyLedgerBytesDoc ann Source #

prettyList ∷ [LedgerBytes] → Doc ann Source #

Pretty ScriptContext 
Instance details

Defined in PlutusLedgerApi.V1.Contexts

Pretty ScriptPurpose 
Instance details

Defined in PlutusLedgerApi.V1.Contexts

Pretty TxInInfo 
Instance details

Defined in PlutusLedgerApi.V1.Contexts

Methods

prettyTxInInfoDoc ann Source #

prettyList ∷ [TxInInfo] → Doc ann Source #

Pretty TxInfo 
Instance details

Defined in PlutusLedgerApi.V1.Contexts

Methods

prettyTxInfoDoc ann Source #

prettyList ∷ [TxInfo] → Doc ann Source #

Pretty Credential 
Instance details

Defined in PlutusLedgerApi.V1.Credential

Methods

prettyCredentialDoc ann Source #

prettyList ∷ [Credential] → Doc ann Source #

Pretty StakingCredential 
Instance details

Defined in PlutusLedgerApi.V1.Credential

Pretty PubKeyHash

using hex encoding

Instance details

Defined in PlutusLedgerApi.V1.Crypto

Methods

prettyPubKeyHashDoc ann Source #

prettyList ∷ [PubKeyHash] → Doc ann Source #

Pretty DCert 
Instance details

Defined in PlutusLedgerApi.V1.DCert

Methods

prettyDCertDoc ann Source #

prettyList ∷ [DCert] → Doc ann Source #

Pretty Context 
Instance details

Defined in PlutusLedgerApi.V1.Scripts

Methods

prettyContextDoc ann Source #

prettyList ∷ [Context] → Doc ann Source #

Pretty Datum 
Instance details

Defined in PlutusLedgerApi.V1.Scripts

Methods

prettyDatumDoc ann Source #

prettyList ∷ [Datum] → Doc ann Source #

Pretty DatumHash

using hex encoding

Instance details

Defined in PlutusLedgerApi.V1.Scripts

Methods

prettyDatumHashDoc ann Source #

prettyList ∷ [DatumHash] → Doc ann Source #

Pretty Redeemer 
Instance details

Defined in PlutusLedgerApi.V1.Scripts

Methods

prettyRedeemerDoc ann Source #

prettyList ∷ [Redeemer] → Doc ann Source #

Pretty RedeemerHash

using hex encoding

Instance details

Defined in PlutusLedgerApi.V1.Scripts

Methods

prettyRedeemerHashDoc ann Source #

prettyList ∷ [RedeemerHash] → Doc ann Source #

Pretty ScriptHash

using hex encoding

Instance details

Defined in PlutusLedgerApi.V1.Scripts

Methods

prettyScriptHashDoc ann Source #

prettyList ∷ [ScriptHash] → Doc ann Source #

Pretty POSIXTime 
Instance details

Defined in PlutusLedgerApi.V1.Time

Methods

prettyPOSIXTimeDoc ann Source #

prettyList ∷ [POSIXTime] → Doc ann Source #

Pretty TxId

using hex encoding

Instance details

Defined in PlutusLedgerApi.V1.Tx

Methods

prettyTxIdDoc ann Source #

prettyList ∷ [TxId] → Doc ann Source #

Pretty TxOut 
Instance details

Defined in PlutusLedgerApi.V1.Tx

Methods

prettyTxOutDoc ann Source #

prettyList ∷ [TxOut] → Doc ann Source #

Pretty TxOutRef 
Instance details

Defined in PlutusLedgerApi.V1.Tx

Methods

prettyTxOutRefDoc ann Source #

prettyList ∷ [TxOutRef] → Doc ann Source #

Pretty AssetClass 
Instance details

Defined in PlutusLedgerApi.V1.Value

Methods

prettyAssetClassDoc ann Source #

prettyList ∷ [AssetClass] → Doc ann Source #

Pretty CurrencySymbol

using hex encoding

Instance details

Defined in PlutusLedgerApi.V1.Value

Pretty Lovelace 
Instance details

Defined in PlutusLedgerApi.V1.Value

Methods

prettyLovelaceDoc ann Source #

prettyList ∷ [Lovelace] → Doc ann Source #

Pretty TokenName 
Instance details

Defined in PlutusLedgerApi.V1.Value

Methods

prettyTokenNameDoc ann Source #

prettyList ∷ [TokenName] → Doc ann Source #

Pretty Value 
Instance details

Defined in PlutusLedgerApi.V1.Value

Methods

prettyValueDoc ann Source #

prettyList ∷ [Value] → Doc ann Source #

Pretty ScriptContext 
Instance details

Defined in PlutusLedgerApi.V2.Contexts

Pretty TxInInfo 
Instance details

Defined in PlutusLedgerApi.V2.Contexts

Methods

prettyTxInInfoDoc ann Source #

prettyList ∷ [TxInInfo] → Doc ann Source #

Pretty TxInfo 
Instance details

Defined in PlutusLedgerApi.V2.Contexts

Methods

prettyTxInfoDoc ann Source #

prettyList ∷ [TxInfo] → Doc ann Source #

Pretty OutputDatum 
Instance details

Defined in PlutusLedgerApi.V2.Tx

Methods

prettyOutputDatumDoc ann Source #

prettyList ∷ [OutputDatum] → Doc ann Source #

Pretty TxOut 
Instance details

Defined in PlutusLedgerApi.V2.Tx

Methods

prettyTxOutDoc ann Source #

prettyList ∷ [TxOut] → Doc ann Source #

Pretty ChangedParameters 
Instance details

Defined in PlutusLedgerApi.V3.Contexts

Pretty ColdCommitteeCredential 
Instance details

Defined in PlutusLedgerApi.V3.Contexts

Pretty Committee 
Instance details

Defined in PlutusLedgerApi.V3.Contexts

Methods

prettyCommitteeDoc ann Source #

prettyList ∷ [Committee] → Doc ann Source #

Pretty Constitution 
Instance details

Defined in PlutusLedgerApi.V3.Contexts

Methods

prettyConstitutionDoc ann Source #

prettyList ∷ [Constitution] → Doc ann Source #

Pretty DRep 
Instance details

Defined in PlutusLedgerApi.V3.Contexts

Methods

prettyDRepDoc ann Source #

prettyList ∷ [DRep] → Doc ann Source #

Pretty DRepCredential 
Instance details

Defined in PlutusLedgerApi.V3.Contexts

Pretty Delegatee 
Instance details

Defined in PlutusLedgerApi.V3.Contexts

Methods

prettyDelegateeDoc ann Source #

prettyList ∷ [Delegatee] → Doc ann Source #

Pretty GovernanceAction 
Instance details

Defined in PlutusLedgerApi.V3.Contexts

Pretty GovernanceActionId 
Instance details

Defined in PlutusLedgerApi.V3.Contexts

Pretty HotCommitteeCredential 
Instance details

Defined in PlutusLedgerApi.V3.Contexts

Pretty ProposalProcedure 
Instance details

Defined in PlutusLedgerApi.V3.Contexts

Pretty ProtocolVersion 
Instance details

Defined in PlutusLedgerApi.V3.Contexts

Pretty ScriptContext 
Instance details

Defined in PlutusLedgerApi.V3.Contexts

Pretty ScriptPurpose 
Instance details

Defined in PlutusLedgerApi.V3.Contexts

Pretty TxCert 
Instance details

Defined in PlutusLedgerApi.V3.Contexts

Methods

prettyTxCertDoc ann Source #

prettyList ∷ [TxCert] → Doc ann Source #

Pretty TxInInfo 
Instance details

Defined in PlutusLedgerApi.V3.Contexts

Methods

prettyTxInInfoDoc ann Source #

prettyList ∷ [TxInInfo] → Doc ann Source #

Pretty TxInfo 
Instance details

Defined in PlutusLedgerApi.V3.Contexts

Methods

prettyTxInfoDoc ann Source #

prettyList ∷ [TxInfo] → Doc ann Source #

Pretty Vote 
Instance details

Defined in PlutusLedgerApi.V3.Contexts

Methods

prettyVoteDoc ann Source #

prettyList ∷ [Vote] → Doc ann Source #

Pretty Voter 
Instance details

Defined in PlutusLedgerApi.V3.Contexts

Methods

prettyVoterDoc ann Source #

prettyList ∷ [Voter] → Doc ann Source #

Pretty TxId

using hex encoding

Instance details

Defined in PlutusLedgerApi.V3.Tx

Methods

prettyTxIdDoc ann Source #

prettyList ∷ [TxId] → Doc ann Source #

Pretty TxOutRef 
Instance details

Defined in PlutusLedgerApi.V3.Tx

Methods

prettyTxOutRefDoc ann Source #

prettyList ∷ [TxOutRef] → Doc ann Source #

Pretty BuiltinBLS12_381_G1_Element 
Instance details

Defined in PlutusTx.Builtins.Internal

Pretty BuiltinBLS12_381_G2_Element 
Instance details

Defined in PlutusTx.Builtins.Internal

Pretty BuiltinBLS12_381_MlResult 
Instance details

Defined in PlutusTx.Builtins.Internal

Pretty BuiltinByteString 
Instance details

Defined in PlutusTx.Builtins.Internal

Pretty BuiltinData 
Instance details

Defined in PlutusTx.Builtins.Internal

Methods

prettyBuiltinDataDoc ann Source #

prettyList ∷ [BuiltinData] → Doc ann Source #

Pretty CovLoc 
Instance details

Defined in PlutusTx.Coverage

Methods

prettyCovLocDoc ann Source #

prettyList ∷ [CovLoc] → Doc ann Source #

Pretty CoverageAnnotation 
Instance details

Defined in PlutusTx.Coverage

Pretty CoverageMetadata 
Instance details

Defined in PlutusTx.Coverage

Pretty CoverageReport 
Instance details

Defined in PlutusTx.Coverage

Pretty Metadata 
Instance details

Defined in PlutusTx.Coverage

Methods

prettyMetadataDoc ann Source #

prettyList ∷ [Metadata] → Doc ann Source #

Pretty Rational 
Instance details

Defined in PlutusTx.Ratio

Methods

prettyRationalDoc ann Source #

prettyList ∷ [Rational] → Doc ann Source #

Pretty Text

Automatically converts all newlines to line.

>>> pretty ("hello\nworld" :: Text)
hello
world

Note that line can be undone by group:

>>> group (pretty ("hello\nworld" :: Text))
hello world

Manually use hardline if you definitely want newlines.

Instance details

Defined in Prettyprinter.Internal

Methods

prettyTextDoc ann Source #

prettyList ∷ [Text] → Doc ann Source #

Pretty Text

(lazy Doc instance, identical to the strict version)

Instance details

Defined in Prettyprinter.Internal

Methods

prettyTextDoc ann Source #

prettyList ∷ [Text] → Doc ann Source #

Pretty Integer
>>> pretty (2^123 :: Integer)
10633823966279326983230456482242756608
Instance details

Defined in Prettyprinter.Internal

Methods

prettyIntegerDoc ann Source #

prettyList ∷ [Integer] → Doc ann Source #

Pretty Natural 
Instance details

Defined in Prettyprinter.Internal

Methods

prettyNaturalDoc ann Source #

prettyList ∷ [Natural] → Doc ann Source #

Pretty ()
>>> pretty ()
()

The argument is not used:

>>> pretty (error "Strict?" :: ())
()
Instance details

Defined in Prettyprinter.Internal

Methods

pretty ∷ () → Doc ann Source #

prettyList ∷ [()] → Doc ann Source #

Pretty Bool
>>> pretty True
True
Instance details

Defined in Prettyprinter.Internal

Methods

prettyBoolDoc ann Source #

prettyList ∷ [Bool] → Doc ann Source #

Pretty Char

Instead of (pretty 'n'), consider using line as a more readable alternative.

>>> pretty 'f' <> pretty 'o' <> pretty 'o'
foo
>>> pretty ("string" :: String)
string
Instance details

Defined in Prettyprinter.Internal

Methods

prettyCharDoc ann Source #

prettyList ∷ [Char] → Doc ann Source #

Pretty Double
>>> pretty (exp 1 :: Double)
2.71828182845904...
Instance details

Defined in Prettyprinter.Internal

Methods

prettyDoubleDoc ann Source #

prettyList ∷ [Double] → Doc ann Source #

Pretty Float
>>> pretty (pi :: Float)
3.1415927
Instance details

Defined in Prettyprinter.Internal

Methods

prettyFloatDoc ann Source #

prettyList ∷ [Float] → Doc ann Source #

Pretty Int
>>> pretty (123 :: Int)
123
Instance details

Defined in Prettyprinter.Internal

Methods

prettyIntDoc ann Source #

prettyList ∷ [Int] → Doc ann Source #

Pretty Word 
Instance details

Defined in Prettyprinter.Internal

Methods

prettyWordDoc ann Source #

prettyList ∷ [Word] → Doc ann Source #

Pretty a ⇒ Pretty (Identity a)
>>> pretty (Identity 1)
1
Instance details

Defined in Prettyprinter.Internal

Methods

prettyIdentity a → Doc ann Source #

prettyList ∷ [Identity a] → Doc ann Source #

Pretty (ShelleyBasedEra era) 
Instance details

Defined in Cardano.Api.Eon.ShelleyBasedEra

Methods

prettyShelleyBasedEra era → Doc ann Source #

prettyList ∷ [ShelleyBasedEra era] → Doc ann Source #

Pretty (CardanoEra era) 
Instance details

Defined in Cardano.Api.Eras.Core

Methods

prettyCardanoEra era → Doc ann Source #

prettyList ∷ [CardanoEra era] → Doc ann Source #

Show a ⇒ Pretty (ShowOf a) 
Instance details

Defined in Cardano.Api.Via.ShowOf

Methods

prettyShowOf a → Doc ann Source #

prettyList ∷ [ShowOf a] → Doc ann Source #

Pretty (BuiltinSemanticsVariant DefaultFun) 
Instance details

Defined in PlutusCore.Default.Builtins

Pretty a ⇒ Pretty (Normalized a) 
Instance details

Defined in PlutusCore.Core.Type

Methods

prettyNormalized a → Doc ann Source #

prettyList ∷ [Normalized a] → Doc ann Source #

Pretty (DefaultUni a)

This always pretty-prints parens around type applications (e.g. (list bool)) and doesn't pretty-print them otherwise (e.g. integer).

Instance details

Defined in PlutusCore.Default.Universe

Methods

prettyDefaultUni a → Doc ann Source #

prettyList ∷ [DefaultUni a] → Doc ann Source #

Pretty ann ⇒ Pretty (UniqueError ann) 
Instance details

Defined in PlutusCore.Error

Methods

prettyUniqueError ann → Doc ann0 Source #

prettyList ∷ [UniqueError ann] → Doc ann0 Source #

PrettyClassic a ⇒ Pretty (EvaluationResult a) 
Instance details

Defined in PlutusCore.Evaluation.Result

PrettyReadable a ⇒ Pretty (AsReadable a) 
Instance details

Defined in PlutusCore.Pretty.Readable

Methods

prettyAsReadable a → Doc ann Source #

prettyList ∷ [AsReadable a] → Doc ann Source #

Pretty (SomeTypeIn DefaultUni) 
Instance details

Defined in PlutusCore.Default.Universe

(Show fun, Ord fun) ⇒ Pretty (CekExTally fun) 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.ExBudgetMode

Methods

prettyCekExTally fun → Doc ann Source #

prettyList ∷ [CekExTally fun] → Doc ann Source #

(Show fun, Ord fun) ⇒ Pretty (TallyingSt fun) 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.ExBudgetMode

Methods

prettyTallyingSt fun → Doc ann Source #

prettyList ∷ [TallyingSt fun] → Doc ann Source #

Show fun ⇒ Pretty (ExBudgetCategory fun) 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

Methods

prettyExBudgetCategory fun → Doc ann Source #

prettyList ∷ [ExBudgetCategory fun] → Doc ann Source #

Pretty a ⇒ Pretty (Provenance a) 
Instance details

Defined in PlutusIR.Compiler.Provenance

Methods

prettyProvenance a → Doc ann Source #

prettyList ∷ [Provenance a] → Doc ann Source #

Pretty a ⇒ Pretty (Extended a) 
Instance details

Defined in PlutusLedgerApi.V1.Interval

Methods

prettyExtended a → Doc ann Source #

prettyList ∷ [Extended a] → Doc ann Source #

Pretty a ⇒ Pretty (Interval a) 
Instance details

Defined in PlutusLedgerApi.V1.Interval

Methods

prettyInterval a → Doc ann Source #

prettyList ∷ [Interval a] → Doc ann Source #

Pretty a ⇒ Pretty (LowerBound a) 
Instance details

Defined in PlutusLedgerApi.V1.Interval

Methods

prettyLowerBound a → Doc ann Source #

prettyList ∷ [LowerBound a] → Doc ann Source #

Pretty a ⇒ Pretty (UpperBound a) 
Instance details

Defined in PlutusLedgerApi.V1.Interval

Methods

prettyUpperBound a → Doc ann Source #

prettyList ∷ [UpperBound a] → Doc ann Source #

Show a ⇒ Pretty (PrettyShow a) 
Instance details

Defined in Prettyprinter.Extras

Methods

prettyPrettyShow a → Doc ann Source #

prettyList ∷ [PrettyShow a] → Doc ann Source #

Pretty a ⇒ Pretty (NonEmpty a) 
Instance details

Defined in Prettyprinter.Internal

Methods

prettyNonEmpty a → Doc ann Source #

prettyList ∷ [NonEmpty a] → Doc ann Source #

Pretty a ⇒ Pretty (Maybe a)

Ignore Nothings, print Just contents.

>>> pretty (Just True)
True
>>> braces (pretty (Nothing :: Maybe Bool))
{}
>>> pretty [Just 1, Nothing, Just 3, Nothing]
[1, 3]
Instance details

Defined in Prettyprinter.Internal

Methods

prettyMaybe a → Doc ann Source #

prettyList ∷ [Maybe a] → Doc ann Source #

Pretty a ⇒ Pretty [a]
>>> pretty [1,2,3]
[1, 2, 3]
Instance details

Defined in Prettyprinter.Internal

Methods

pretty ∷ [a] → Doc ann Source #

prettyList ∷ [[a]] → Doc ann Source #

(Pretty err, Pretty cause) ⇒ Pretty (ErrorWithCause err cause) 
Instance details

Defined in PlutusCore.Evaluation.ErrorWithCause

Methods

prettyErrorWithCause err cause → Doc ann Source #

prettyList ∷ [ErrorWithCause err cause] → Doc ann Source #

(Foldable f, Pretty a) ⇒ Pretty (PrettyFoldable f a) 
Instance details

Defined in Prettyprinter.Extras

Methods

prettyPrettyFoldable f a → Doc ann Source #

prettyList ∷ [PrettyFoldable f a] → Doc ann Source #

(Pretty k, Pretty v) ⇒ Pretty (Map k v) 
Instance details

Defined in PlutusTx.AssocMap

Methods

prettyMap k v → Doc ann Source #

prettyList ∷ [Map k v] → Doc ann Source #

DefaultPrettyBy config a ⇒ Pretty (AttachDefaultPrettyConfig config a) 
Instance details

Defined in Text.PrettyBy.Internal

Methods

prettyAttachDefaultPrettyConfig config a → Doc ann Source #

prettyList ∷ [AttachDefaultPrettyConfig config a] → Doc ann Source #

PrettyBy config a ⇒ Pretty (AttachPrettyConfig config a)
>>> data Cfg = Cfg
>>> data D = D
>>> instance PrettyBy Cfg D where prettyBy Cfg D = "D"
>>> pretty $ AttachPrettyConfig Cfg D
D
Instance details

Defined in Text.PrettyBy.Internal

Methods

prettyAttachPrettyConfig config a → Doc ann Source #

prettyList ∷ [AttachPrettyConfig config a] → Doc ann Source #

(Pretty a1, Pretty a2) ⇒ Pretty (a1, a2)
>>> pretty (123, "hello")
(123, hello)
Instance details

Defined in Prettyprinter.Internal

Methods

pretty ∷ (a1, a2) → Doc ann Source #

prettyList ∷ [(a1, a2)] → Doc ann Source #

Pretty a ⇒ Pretty (Const a b) 
Instance details

Defined in Prettyprinter.Internal

Methods

prettyConst a b → Doc ann Source #

prettyList ∷ [Const a b] → Doc ann Source #

(PrettyUni uni, Pretty fun, Pretty ann) ⇒ Pretty (Error uni fun ann) 
Instance details

Defined in PlutusIR.Error

Methods

prettyError uni fun ann → Doc ann0 Source #

prettyList ∷ [Error uni fun ann] → Doc ann0 Source #

(Pretty a1, Pretty a2, Pretty a3) ⇒ Pretty (a1, a2, a3)
>>> pretty (123, "hello", False)
(123, hello, False)
Instance details

Defined in Prettyprinter.Internal

Methods

pretty ∷ (a1, a2, a3) → Doc ann Source #

prettyList ∷ [(a1, a2, a3)] → Doc ann Source #