plutarch
Safe HaskellNone
LanguageGHC2021

Plutarch.Internal.Show

Synopsis

Documentation

class PShow (t :: S -> Type) where Source #

Allows a debugging representation of the datatype as a PString.

Important note

Use of PShow in production scripts is not a good idea, as it requires considerable script budget, especially for larger or more complex values. In general, this type class is provided to assist with testing or debugging: be very careful when using it for anything else, lest it impact your performance.

Writing manual instances of this type class is also discouraged, as it is not intended to be a pretty printer. In most situations, the Generic-based derivation of instances for this type class is what you want.

Minimal complete definition

Nothing

Methods

pshow' :: forall (s :: S). Bool -> Term s t -> Term s PString Source #

Return the PString representation of a Plutarch value.

If the argument is True, wrap the output in `(..)` if it represents multiple parameters.

Since: 1.13.0

default pshow' :: forall (s :: S). (PGeneric t, PlutusType t, All2 PShow (PCode t)) => Bool -> Term s t -> Term s PString Source #

Instances

Instances details
PShow PBool Source # 
Instance details

Defined in Plutarch.Internal.Show

Methods

pshow' :: forall (s :: S). Bool -> Term s PBool -> Term s PString Source #

PShow PByteString Source # 
Instance details

Defined in Plutarch.Internal.Show

Methods

pshow' :: forall (s :: S). Bool -> Term s PByteString -> Term s PString Source #

PShow PData Source # 
Instance details

Defined in Plutarch.Internal.Show

Methods

pshow' :: forall (s :: S). Bool -> Term s PData -> Term s PString Source #

PShow PInteger Source # 
Instance details

Defined in Plutarch.Internal.Show

Methods

pshow' :: forall (s :: S). Bool -> Term s PInteger -> Term s PString Source #

PShow PString Source # 
Instance details

Defined in Plutarch.Internal.Show

Methods

pshow' :: forall (s :: S). Bool -> Term s PString -> Term s PString Source #

PShow PUnit Source # 
Instance details

Defined in Plutarch.Internal.Show

Methods

pshow' :: forall (s :: S). Bool -> Term s PUnit -> Term s PString Source #

PShow PNatural Source #

Since: 1.13.0

Instance details

Defined in Plutarch.Internal.Show

Methods

pshow' :: forall (s :: S). Bool -> Term s PNatural -> Term s PString Source #

PShow PPositive Source #

Since: 1.10.0

Instance details

Defined in Plutarch.Internal.Show

Methods

pshow' :: forall (s :: S). Bool -> Term s PPositive -> Term s PString Source #

PShow PRational Source # 
Instance details

Defined in Plutarch.Rational

Methods

pshow' :: forall (s :: S). Bool -> Term s PRational -> Term s PString Source #

(PIsData a, PShow a) => PShow (PAsData a) Source # 
Instance details

Defined in Plutarch.Internal.Show

Methods

pshow' :: forall (s :: S). Bool -> Term s (PAsData a) -> Term s PString Source #

(PShow a, Contains DefaultUni (PlutusRepr a)) => PShow (PBuiltinList a) Source # 
Instance details

Defined in Plutarch.Internal.Show

Methods

pshow' :: forall (s :: S). Bool -> Term s (PBuiltinList a) -> Term s PString Source #

(All (Top :: PLabeledType -> Constraint) xs, KnownSymbol label, PIsData x, PShow x, PShow (PDataRecordShowHelper xs)) => PShow (PDataRecord ((label ':= x) ': xs)) Source # 
Instance details

Defined in Plutarch.DataRepr.Internal

Methods

pshow' :: forall (s :: S). Bool -> Term s (PDataRecord ((label ':= x) ': xs)) -> Term s PString Source #

PShow (PDataRecord ('[] :: [PLabeledType])) Source # 
Instance details

Defined in Plutarch.DataRepr.Internal

Methods

pshow' :: forall (s :: S). Bool -> Term s (PDataRecord ('[] :: [PLabeledType])) -> Term s PString Source #

(All (Top :: [PLabeledType] -> Constraint) defs, All (Compose PShow PDataRecord) defs) => PShow (PDataSum defs) Source # 
Instance details

Defined in Plutarch.DataRepr.Internal

Methods

pshow' :: forall (s :: S). Bool -> Term s (PDataSum defs) -> Term s PString Source #

PShow a => PShow (PList a) Source # 
Instance details

Defined in Plutarch.List

Methods

pshow' :: forall (s :: S). Bool -> Term s (PList a) -> Term s PString Source #

PShow a => PShow (PMaybe a) Source #

Since: 1.10.0

Instance details

Defined in Plutarch.Internal.Show

Methods

pshow' :: forall (s :: S). Bool -> Term s (PMaybe a) -> Term s PString Source #

(PShow a, PShow b) => PShow (PBuiltinPair a b) Source # 
Instance details

Defined in Plutarch.Internal.Show

Methods

pshow' :: forall (s :: S). Bool -> Term s (PBuiltinPair a b) -> Term s PString Source #

(PShow a, PShow b) => PShow (PEither a b) Source #

Since: 1.10.0

Instance details

Defined in Plutarch.Either

Methods

pshow' :: forall (s :: S). Bool -> Term s (PEither a b) -> Term s PString Source #

(PIsData a, PIsData b, PShow a, PShow b) => PShow (PEitherData a b) Source #

Since: 1.10.0

Instance details

Defined in Plutarch.Either

Methods

pshow' :: forall (s :: S). Bool -> Term s (PEitherData a b) -> Term s PString Source #

(PShow a, PShow b) => PShow (PPair a b) Source #

Since: 1.10.0

Instance details

Defined in Plutarch.Pair

Methods

pshow' :: forall (s :: S). Bool -> Term s (PPair a b) -> Term s PString Source #

pshow :: forall (a :: S -> Type) (s :: S). PShow a => Term s a -> Term s PString Source #

Return the string representation of a Plutarch value

pshowAndErr :: forall (s :: S) (a :: S -> Type) (b :: S -> Type). Term s a -> Term s b Source #

Causes an error where the input is shown in the message. Works for all types.

pshowList :: forall (list :: (S -> Type) -> S -> Type) (a :: S -> Type) (s :: S). (PShow a, PIsListLike list a) => Term s (list a :--> PString) Source #