plutarch-1.9.0
Safe HaskellSafe-Inferred
LanguageGHC2021

Plutarch.Builtin

Synopsis

Documentation

data PData (s :: S) Source #

Instances

Instances details
PIsData PData Source # 
Instance details

Defined in Plutarch.Builtin

Methods

pfromDataImpl :: forall (s :: S). Term s (PAsData PData) -> Term s PData Source #

pdataImpl :: forall (s :: S). Term s PData -> Term s PData Source #

PEq PData Source # 
Instance details

Defined in Plutarch.Builtin

Methods

(#==) :: forall (s :: S). Term s PData -> Term s PData -> Term s PBool Source #

PLiftable PData Source # 
Instance details

Defined in Plutarch.Builtin

Associated Types

type AsHaskell PData Source #

type PlutusRepr PData Source #

PlutusType PData Source # 
Instance details

Defined in Plutarch.Builtin

Methods

pcon' :: forall (s :: S). PData s -> Term s (PInner PData) Source #

pmatch' :: forall (s :: S) (b :: PType). Term s (PInner PData) -> (PData s -> Term s b) -> Term s b Source #

PShow PData Source # 
Instance details

Defined in Plutarch.Builtin

Methods

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

PTryFrom PData PData Source # 
Instance details

Defined in Plutarch.Builtin

Associated Types

type PTryFromExcess PData PData :: PType Source #

Methods

ptryFrom' :: forall (s :: S) (r :: PType). Term s PData -> ((Term s PData, Reduce (PTryFromExcess PData PData s)) -> Term s r) -> Term s r Source #

(PTryFrom PData (PAsData a), PIsData a) => PTryFrom PData (PAsData (PBuiltinList (PAsData a))) Source #

Recover a `PBuiltinList (PAsData a)`

Instance details

Defined in Plutarch.Builtin

Associated Types

type PTryFromExcess PData (PAsData (PBuiltinList (PAsData a))) :: PType Source #

Methods

ptryFrom' :: forall (s :: S) (r :: PType). Term s PData -> ((Term s (PAsData (PBuiltinList (PAsData a))), Reduce (PTryFromExcess PData (PAsData (PBuiltinList (PAsData a))) s)) -> Term s r) -> Term s r Source #

PTryFrom PData (PAsData (PBuiltinList PData)) Source #

This verifies a list to be indeed a list but doesn't recover the inner data use this instance instead of the one for `PData (PAsData (PBuiltinList (PAsData a)))` as this is O(1) instead of O(n)

Instance details

Defined in Plutarch.Builtin

Methods

ptryFrom' :: forall (s :: S) (r :: PType). Term s PData -> ((Term s (PAsData (PBuiltinList PData)), Reduce (PTryFromExcess PData (PAsData (PBuiltinList PData)) s)) -> Term s r) -> Term s r Source #

(PTryFrom PData a, a ~ PAsData a', PIsData a', PTryFrom PData b, b ~ PAsData b', PIsData b') => PTryFrom PData (PAsData (PBuiltinPair a b)) Source #

Recover a `PAsData (PBuiltinPair a b)`

Instance details

Defined in Plutarch.Builtin

Associated Types

type PTryFromExcess PData (PAsData (PBuiltinPair a b)) :: PType Source #

Methods

ptryFrom' :: forall (s :: S) (r :: PType). Term s PData -> ((Term s (PAsData (PBuiltinPair a b)), Reduce (PTryFromExcess PData (PAsData (PBuiltinPair a b)) s)) -> Term s r) -> Term s r Source #

PTryFrom PData (PAsData PData) Source # 
Instance details

Defined in Plutarch.Builtin

Associated Types

type PTryFromExcess PData (PAsData PData) :: PType Source #

Methods

ptryFrom' :: forall (s :: S) (r :: PType). Term s PData -> ((Term s (PAsData PData), Reduce (PTryFromExcess PData (PAsData PData) s)) -> Term s r) -> Term s r Source #

PTryFrom PData (PAsData (PDataNewtype a)) Source #

Since: 1.7.0

Instance details

Defined in Plutarch.Builtin

Associated Types

type PTryFromExcess PData (PAsData (PDataNewtype a)) :: PType Source #

Methods

ptryFrom' :: forall (s :: S) (r :: PType). Term s PData -> ((Term s (PAsData (PDataNewtype a)), Reduce (PTryFromExcess PData (PAsData (PDataNewtype a)) s)) -> Term s r) -> Term s r Source #

PTryFrom PData (PAsData PBool) Source #

Since: 1.7.0

Instance details

Defined in Plutarch.Builtin

Associated Types

type PTryFromExcess PData (PAsData PBool) :: PType Source #

Methods

ptryFrom' :: forall (s :: S) (r :: PType). Term s PData -> ((Term s (PAsData PBool), Reduce (PTryFromExcess PData (PAsData PBool) s)) -> Term s r) -> Term s r Source #

PTryFrom PData (PAsData PByteString) Source # 
Instance details

Defined in Plutarch.Builtin

Methods

ptryFrom' :: forall (s :: S) (r :: PType). Term s PData -> ((Term s (PAsData PByteString), Reduce (PTryFromExcess PData (PAsData PByteString) s)) -> Term s r) -> Term s r Source #

(PTryFrom (PBuiltinList PData) (PDataRecord as), PTryFromExcess (PBuiltinList PData) (PDataRecord as) ~ HRecP ase) => PTryFrom PData (PAsData (PDataRecord as)) Source # 
Instance details

Defined in Plutarch.DataRepr.Internal

Associated Types

type PTryFromExcess PData (PAsData (PDataRecord as)) :: PType Source #

Methods

ptryFrom' :: forall (s :: S) (r :: PType). Term s PData -> ((Term s (PAsData (PDataRecord as)), Reduce (PTryFromExcess PData (PAsData (PDataRecord as)) s)) -> Term s r) -> Term s r Source #

PTryFrom PData (PDataSum ys) => PTryFrom PData (PAsData (PDataSum ys)) Source # 
Instance details

Defined in Plutarch.DataRepr.Internal

Associated Types

type PTryFromExcess PData (PAsData (PDataSum ys)) :: PType Source #

Methods

ptryFrom' :: forall (s :: S) (r :: PType). Term s PData -> ((Term s (PAsData (PDataSum ys)), Reduce (PTryFromExcess PData (PAsData (PDataSum ys)) s)) -> Term s r) -> Term s r Source #

(PTryFrom PData a, PTryFrom PData b) => PTryFrom PData (PAsData (PEitherData a b)) Source #

@since WIP

Instance details

Defined in Plutarch.Either

Associated Types

type PTryFromExcess PData (PAsData (PEitherData a b)) :: PType Source #

Methods

ptryFrom' :: forall (s :: S) (r :: PType). Term s PData -> ((Term s (PAsData (PEitherData a b)), Reduce (PTryFromExcess PData (PAsData (PEitherData a b)) s)) -> Term s r) -> Term s r Source #

PTryFrom PData (PAsData PInteger) Source # 
Instance details

Defined in Plutarch.Builtin

Associated Types

type PTryFromExcess PData (PAsData PInteger) :: PType Source #

Methods

ptryFrom' :: forall (s :: S) (r :: PType). Term s PData -> ((Term s (PAsData PInteger), Reduce (PTryFromExcess PData (PAsData PInteger) s)) -> Term s r) -> Term s r Source #

PTryFrom PData (PAsData PPositive) Source # 
Instance details

Defined in Plutarch.Positive

Associated Types

type PTryFromExcess PData (PAsData PPositive) :: PType Source #

Methods

ptryFrom' :: forall (s :: S) (r :: PType). Term s PData -> ((Term s (PAsData PPositive), Reduce (PTryFromExcess PData (PAsData PPositive) s)) -> Term s r) -> Term s r Source #

PTryFrom PData (PAsData PRational) Source #

NOTE: This instance produces a verified PPositive as the excess output.

Instance details

Defined in Plutarch.Rational

Associated Types

type PTryFromExcess PData (PAsData PRational) :: PType Source #

Methods

ptryFrom' :: forall (s :: S) (r :: PType). Term s PData -> ((Term s (PAsData PRational), Reduce (PTryFromExcess PData (PAsData PRational) s)) -> Term s r) -> Term s r Source #

(PIsData a, PTryFrom PData (PAsData a)) => PTryFrom PData (PDataNewtype a) Source #

Since: 1.7.0

Instance details

Defined in Plutarch.Builtin

Associated Types

type PTryFromExcess PData (PDataNewtype a) :: PType Source #

Methods

ptryFrom' :: forall (s :: S) (r :: PType). Term s PData -> ((Term s (PDataNewtype a), Reduce (PTryFromExcess PData (PDataNewtype a) s)) -> Term s r) -> Term s r Source #

SumValidation 0 ys => PTryFrom PData (PDataSum ys) Source # 
Instance details

Defined in Plutarch.DataRepr.Internal

Associated Types

type PTryFromExcess PData (PDataSum ys) :: PType Source #

Methods

ptryFrom' :: forall (s :: S) (r :: PType). Term s PData -> ((Term s (PDataSum ys), Reduce (PTryFromExcess PData (PDataSum ys) s)) -> Term s r) -> Term s r Source #

(PTryFrom PData a, PTryFrom PData b) => PTryFrom PData (PEitherData a b) Source #

@since WIP

Instance details

Defined in Plutarch.Either

Associated Types

type PTryFromExcess PData (PEitherData a b) :: PType Source #

Methods

ptryFrom' :: forall (s :: S) (r :: PType). Term s PData -> ((Term s (PEitherData a b), Reduce (PTryFromExcess PData (PEitherData a b) s)) -> Term s r) -> Term s r Source #

PLiftable (PAsData PData) Source # 
Instance details

Defined in Plutarch.Builtin

Associated Types

type AsHaskell (PAsData PData) Source #

type PlutusRepr (PAsData PData) Source #

(Helper2 (PSubtype' PData pty) pty, PTryFrom (PBuiltinList PData) (PDataRecord as), PTryFromExcess (PBuiltinList PData) (PDataRecord as) ~ HRecP ase) => PTryFrom (PBuiltinList PData) (PDataRecord ((name ':= pty) ': as)) Source # 
Instance details

Defined in Plutarch.DataRepr.Internal

Associated Types

type PTryFromExcess (PBuiltinList PData) (PDataRecord ((name ':= pty) ': as)) :: PType Source #

Methods

ptryFrom' :: forall (s :: S) (r :: PType). Term s (PBuiltinList PData) -> ((Term s (PDataRecord ((name ':= pty) ': as)), Reduce (PTryFromExcess (PBuiltinList PData) (PDataRecord ((name ':= pty) ': as)) s)) -> Term s r) -> Term s r Source #

PTryFrom (PBuiltinList PData) (PDataRecord ('[] :: [PLabeledType])) Source # 
Instance details

Defined in Plutarch.DataRepr.Internal

Associated Types

type PTryFromExcess (PBuiltinList PData) (PDataRecord '[]) :: PType Source #

Methods

ptryFrom' :: forall (s :: S) (r :: PType). Term s (PBuiltinList PData) -> ((Term s (PDataRecord '[]), Reduce (PTryFromExcess (PBuiltinList PData) (PDataRecord '[]) s)) -> Term s r) -> Term s r Source #

PIsData (PBuiltinPair PData PData) Source # 
Instance details

Defined in Plutarch.Builtin

PIsData (PBuiltinPair PInteger (PBuiltinList PData)) Source # 
Instance details

Defined in Plutarch.Builtin

type AsHaskell PData Source #

@since WIP

Instance details

Defined in Plutarch.Builtin

type PlutusRepr PData Source # 
Instance details

Defined in Plutarch.Builtin

type PContravariant' PData Source # 
Instance details

Defined in Plutarch.Builtin

type PCovariant' PData Source # 
Instance details

Defined in Plutarch.Builtin

type PCovariant' PData = ()
type PInner PData Source # 
Instance details

Defined in Plutarch.Builtin

type PVariant' PData Source # 
Instance details

Defined in Plutarch.Builtin

type PVariant' PData = ()
type PTryFromExcess PData PData Source # 
Instance details

Defined in Plutarch.Builtin

type PTryFromExcess PData (PAsData (PBuiltinList (PAsData a))) Source # 
Instance details

Defined in Plutarch.Builtin

type PTryFromExcess PData (PAsData (PBuiltinList PData)) Source # 
Instance details

Defined in Plutarch.Builtin

type PTryFromExcess PData (PAsData (PBuiltinPair a b)) Source # 
Instance details

Defined in Plutarch.Builtin

type PTryFromExcess PData (PAsData PData) Source # 
Instance details

Defined in Plutarch.Builtin

type PTryFromExcess PData (PAsData (PDataNewtype a)) Source # 
Instance details

Defined in Plutarch.Builtin

type PTryFromExcess PData (PAsData PBool) Source # 
Instance details

Defined in Plutarch.Builtin

type PTryFromExcess PData (PAsData PByteString) Source # 
Instance details

Defined in Plutarch.Builtin

type PTryFromExcess PData (PAsData (PDataRecord as)) Source # 
Instance details

Defined in Plutarch.DataRepr.Internal

type PTryFromExcess PData (PAsData (PDataSum ys)) Source # 
Instance details

Defined in Plutarch.DataRepr.Internal

type PTryFromExcess PData (PAsData (PEitherData a b)) Source # 
Instance details

Defined in Plutarch.Either

type PTryFromExcess PData (PAsData PInteger) Source # 
Instance details

Defined in Plutarch.Builtin

type PTryFromExcess PData (PAsData PPositive) Source # 
Instance details

Defined in Plutarch.Positive

type PTryFromExcess PData (PAsData PRational) Source # 
Instance details

Defined in Plutarch.Rational

type PTryFromExcess PData (PDataNewtype a) Source # 
Instance details

Defined in Plutarch.Builtin

type PTryFromExcess PData (PDataSum ys) Source # 
Instance details

Defined in Plutarch.DataRepr.Internal

type PTryFromExcess PData (PDataSum ys) = Const () :: S -> Type
type PTryFromExcess PData (PEitherData a b) Source # 
Instance details

Defined in Plutarch.Either

type AsHaskell (PAsData PData) Source # 
Instance details

Defined in Plutarch.Builtin

type PlutusRepr (PAsData PData) Source # 
Instance details

Defined in Plutarch.Builtin

type PlutusRepr (PAsData PData) = Data
type PTryFromExcess (PBuiltinList PData) (PDataRecord ((name ':= pty) ': as)) Source # 
Instance details

Defined in Plutarch.DataRepr.Internal

type PTryFromExcess (PBuiltinList PData) (PDataRecord ((name ':= pty) ': as))
type PTryFromExcess (PBuiltinList PData) (PDataRecord ('[] :: [PLabeledType])) Source # 
Instance details

Defined in Plutarch.DataRepr.Internal

pconstantData :: forall (p :: S -> Type) (h :: Type) (s :: S). (ToData h, AsHaskell p ~ h) => h -> Term s (PAsData p) Source #

Create a Plutarch-level PAsData constant, from a Haskell value. Example: > pconstantData @PInteger 42

data PBuiltinPair (a :: S -> Type) (b :: S -> Type) (s :: S) Source #

Plutus BuiltinPair

Instances

Instances details
(PTryFrom PData a, a ~ PAsData a', PIsData a', PTryFrom PData b, b ~ PAsData b', PIsData b') => PTryFrom PData (PAsData (PBuiltinPair a b)) Source #

Recover a `PAsData (PBuiltinPair a b)`

Instance details

Defined in Plutarch.Builtin

Associated Types

type PTryFromExcess PData (PAsData (PBuiltinPair a b)) :: PType Source #

Methods

ptryFrom' :: forall (s :: S) (r :: PType). Term s PData -> ((Term s (PAsData (PBuiltinPair a b)), Reduce (PTryFromExcess PData (PAsData (PBuiltinPair a b)) s)) -> Term s r) -> Term s r Source #

PIsData (PBuiltinPair (PAsData a) (PAsData b)) Source # 
Instance details

Defined in Plutarch.Builtin

Methods

pfromDataImpl :: forall (s :: S). Term s (PAsData (PBuiltinPair (PAsData a) (PAsData b))) -> Term s (PBuiltinPair (PAsData a) (PAsData b)) Source #

pdataImpl :: forall (s :: S). Term s (PBuiltinPair (PAsData a) (PAsData b)) -> Term s PData Source #

PIsData (PBuiltinPair PData PData) Source # 
Instance details

Defined in Plutarch.Builtin

PIsData (PBuiltinPair PInteger (PBuiltinList PData)) Source # 
Instance details

Defined in Plutarch.Builtin

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

Defined in Plutarch.Builtin

Methods

(#==) :: forall (s :: S). Term s (PBuiltinPair a b) -> Term s (PBuiltinPair a b) -> Term s PBool Source #

(PLiftable a, Contains DefaultUni (PlutusRepr a), PLiftable b, Contains DefaultUni (PlutusRepr b)) => PLiftable (PBuiltinPair a b) Source #

@since WIP

Instance details

Defined in Plutarch.Builtin

Associated Types

type AsHaskell (PBuiltinPair a b) Source #

type PlutusRepr (PBuiltinPair a b) Source #

PlutusType (PBuiltinPair a b) Source # 
Instance details

Defined in Plutarch.Builtin

Methods

pcon' :: forall (s :: S). PBuiltinPair a b s -> Term s (PInner (PBuiltinPair a b)) Source #

pmatch' :: forall (s :: S) (b0 :: PType). Term s (PInner (PBuiltinPair a b)) -> (PBuiltinPair a b s -> Term s b0) -> Term s b0 Source #

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

Defined in Plutarch.Builtin

Methods

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

type PTryFromExcess PData (PAsData (PBuiltinPair a b)) Source # 
Instance details

Defined in Plutarch.Builtin

type AsHaskell (PBuiltinPair a b) Source # 
Instance details

Defined in Plutarch.Builtin

type PlutusRepr (PBuiltinPair a b) Source # 
Instance details

Defined in Plutarch.Builtin

type PContravariant' (PBuiltinPair a b) Source # 
Instance details

Defined in Plutarch.Builtin

type PCovariant' (PBuiltinPair a b) Source # 
Instance details

Defined in Plutarch.Builtin

type PInner (PBuiltinPair a b) Source # 
Instance details

Defined in Plutarch.Builtin

type PVariant' (PBuiltinPair a b) Source # 
Instance details

Defined in Plutarch.Builtin

data PBuiltinList (a :: S -> Type) (s :: S) Source #

Plutus BuiltinList

Constructors

PCons (Term s a) (Term s (PBuiltinList a)) 
PNil 

Instances

Instances details
PListLike PBuiltinList Source # 
Instance details

Defined in Plutarch.Builtin

Associated Types

type PElemConstraint PBuiltinList a Source #

Methods

pelimList :: forall (a :: S -> Type) (s :: S) (r :: PType). PElemConstraint PBuiltinList a => (Term s a -> Term s (PBuiltinList a) -> Term s r) -> Term s r -> Term s (PBuiltinList a) -> Term s r Source #

pcons :: forall (a :: S -> Type) (s :: S). PElemConstraint PBuiltinList a => Term s (a :--> (PBuiltinList a :--> PBuiltinList a)) Source #

pnil :: forall (a :: S -> Type) (s :: S). PElemConstraint PBuiltinList a => Term s (PBuiltinList a) Source #

phead :: forall (a :: S -> Type) (s :: S). PElemConstraint PBuiltinList a => Term s (PBuiltinList a :--> a) Source #

ptail :: forall (a :: S -> Type) (s :: S). PElemConstraint PBuiltinList a => Term s (PBuiltinList a :--> PBuiltinList a) Source #

pnull :: forall (a :: S -> Type) (s :: S). PElemConstraint PBuiltinList a => Term s (PBuiltinList a :--> PBool) Source #

(PTryFrom PData (PAsData a), PIsData a) => PTryFrom PData (PAsData (PBuiltinList (PAsData a))) Source #

Recover a `PBuiltinList (PAsData a)`

Instance details

Defined in Plutarch.Builtin

Associated Types

type PTryFromExcess PData (PAsData (PBuiltinList (PAsData a))) :: PType Source #

Methods

ptryFrom' :: forall (s :: S) (r :: PType). Term s PData -> ((Term s (PAsData (PBuiltinList (PAsData a))), Reduce (PTryFromExcess PData (PAsData (PBuiltinList (PAsData a))) s)) -> Term s r) -> Term s r Source #

PTryFrom PData (PAsData (PBuiltinList PData)) Source #

This verifies a list to be indeed a list but doesn't recover the inner data use this instance instead of the one for `PData (PAsData (PBuiltinList (PAsData a)))` as this is O(1) instead of O(n)

Instance details

Defined in Plutarch.Builtin

Methods

ptryFrom' :: forall (s :: S) (r :: PType). Term s PData -> ((Term s (PAsData (PBuiltinList PData)), Reduce (PTryFromExcess PData (PAsData (PBuiltinList PData)) s)) -> Term s r) -> Term s r Source #

PSubtype PData a => PIsData (PBuiltinList a) Source # 
Instance details

Defined in Plutarch.Builtin

Methods

pfromDataImpl :: forall (s :: S). Term s (PAsData (PBuiltinList a)) -> Term s (PBuiltinList a) Source #

pdataImpl :: forall (s :: S). Term s (PBuiltinList a) -> Term s PData Source #

Fc (F a) a => PEq (PBuiltinList a) Source # 
Instance details

Defined in Plutarch.Builtin

Methods

(#==) :: forall (s :: S). Term s (PBuiltinList a) -> Term s (PBuiltinList a) -> Term s PBool Source #

(PLiftable a, Contains DefaultUni (PlutusRepr a)) => PLiftable (PBuiltinList a) Source #

@since WIP

Instance details

Defined in Plutarch.Builtin

Associated Types

type AsHaskell (PBuiltinList a) Source #

type PlutusRepr (PBuiltinList a) Source #

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

Defined in Plutarch.Builtin

Methods

pcon' :: forall (s :: S). PBuiltinList a s -> Term s (PInner (PBuiltinList a)) Source #

pmatch' :: forall (s :: S) (b :: PType). Term s (PInner (PBuiltinList a)) -> (PBuiltinList a s -> Term s b) -> Term s b Source #

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

Defined in Plutarch.Builtin

Methods

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

(Helper2 (PSubtype' PData pty) pty, PTryFrom (PBuiltinList PData) (PDataRecord as), PTryFromExcess (PBuiltinList PData) (PDataRecord as) ~ HRecP ase) => PTryFrom (PBuiltinList PData) (PDataRecord ((name ':= pty) ': as)) Source # 
Instance details

Defined in Plutarch.DataRepr.Internal

Associated Types

type PTryFromExcess (PBuiltinList PData) (PDataRecord ((name ':= pty) ': as)) :: PType Source #

Methods

ptryFrom' :: forall (s :: S) (r :: PType). Term s (PBuiltinList PData) -> ((Term s (PDataRecord ((name ':= pty) ': as)), Reduce (PTryFromExcess (PBuiltinList PData) (PDataRecord ((name ':= pty) ': as)) s)) -> Term s r) -> Term s r Source #

PTryFrom (PBuiltinList PData) (PDataRecord ('[] :: [PLabeledType])) Source # 
Instance details

Defined in Plutarch.DataRepr.Internal

Associated Types

type PTryFromExcess (PBuiltinList PData) (PDataRecord '[]) :: PType Source #

Methods

ptryFrom' :: forall (s :: S) (r :: PType). Term s (PBuiltinList PData) -> ((Term s (PDataRecord '[]), Reduce (PTryFromExcess (PBuiltinList PData) (PDataRecord '[]) s)) -> Term s r) -> Term s r Source #

PIsData (PBuiltinPair PInteger (PBuiltinList PData)) Source # 
Instance details

Defined in Plutarch.Builtin

type PElemConstraint PBuiltinList a Source # 
Instance details

Defined in Plutarch.Builtin

type PElemConstraint PBuiltinList a = Contains DefaultUni (PlutusRepr a)
type PTryFromExcess PData (PAsData (PBuiltinList (PAsData a))) Source # 
Instance details

Defined in Plutarch.Builtin

type PTryFromExcess PData (PAsData (PBuiltinList PData)) Source # 
Instance details

Defined in Plutarch.Builtin

type AsHaskell (PBuiltinList a) Source # 
Instance details

Defined in Plutarch.Builtin

type PlutusRepr (PBuiltinList a) Source # 
Instance details

Defined in Plutarch.Builtin

type PContravariant' (PBuiltinList a) Source # 
Instance details

Defined in Plutarch.Builtin

type PCovariant' (PBuiltinList a) Source # 
Instance details

Defined in Plutarch.Builtin

type PInner (PBuiltinList a) Source # 
Instance details

Defined in Plutarch.Builtin

type PVariant' (PBuiltinList a) Source # 
Instance details

Defined in Plutarch.Builtin

type PTryFromExcess (PBuiltinList PData) (PDataRecord ((name ':= pty) ': as)) Source # 
Instance details

Defined in Plutarch.DataRepr.Internal

type PTryFromExcess (PBuiltinList PData) (PDataRecord ((name ':= pty) ': as))
type PTryFromExcess (PBuiltinList PData) (PDataRecord ('[] :: [PLabeledType])) Source # 
Instance details

Defined in Plutarch.DataRepr.Internal

pdataLiteral :: Data -> Term s PData Source #

Deprecated: Use pconstant instead.

class PIsData a where Source #

Laws: - If PSubtype PData a, then pdataImpl a must be pupcast. - pdataImpl . pupcast . pfromDataImpl ≡ id - pfromDataImpl . punsafeDowncast . pdataImpl ≡ id

Minimal complete definition

Nothing

Methods

pfromDataImpl :: Term s (PAsData a) -> Term s a Source #

default pfromDataImpl :: PIsData (PInner a) => Term s (PAsData a) -> Term s a Source #

pdataImpl :: Term s a -> Term s PData Source #

default pdataImpl :: PIsData (PInner a) => Term s a -> Term s PData Source #

Instances

Instances details
PIsData PData Source # 
Instance details

Defined in Plutarch.Builtin

Methods

pfromDataImpl :: forall (s :: S). Term s (PAsData PData) -> Term s PData Source #

pdataImpl :: forall (s :: S). Term s PData -> Term s PData Source #

PIsData PBool Source #

Instance for PBool following the Plutus IsData repr given by makeIsDataIndexed ''Bool [('False,0),('True,1)], which is used in TxInfo via Closure.

Instance details

Defined in Plutarch.Builtin

Methods

pfromDataImpl :: forall (s :: S). Term s (PAsData PBool) -> Term s PBool Source #

pdataImpl :: forall (s :: S). Term s PBool -> Term s PData Source #

PIsData PByteString Source # 
Instance details

Defined in Plutarch.Builtin

Methods

pfromDataImpl :: forall (s :: S). Term s (PAsData PByteString) -> Term s PByteString Source #

pdataImpl :: forall (s :: S). Term s PByteString -> Term s PData Source #

PIsData PInteger Source # 
Instance details

Defined in Plutarch.Builtin

Methods

pfromDataImpl :: forall (s :: S). Term s (PAsData PInteger) -> Term s PInteger Source #

pdataImpl :: forall (s :: S). Term s PInteger -> Term s PData Source #

PIsData PPositive Source # 
Instance details

Defined in Plutarch.Positive

Methods

pfromDataImpl :: forall (s :: S). Term s (PAsData PPositive) -> Term s PPositive Source #

pdataImpl :: forall (s :: S). Term s PPositive -> Term s PData Source #

PIsData PRational Source #

This instance _does not_ correspond to Rationals data encoding.

Instance details

Defined in Plutarch.Rational

Methods

pfromDataImpl :: forall (s :: S). Term s (PAsData PRational) -> Term s PRational Source #

pdataImpl :: forall (s :: S). Term s PRational -> Term s PData Source #

PSubtype PData a => PIsData (PBuiltinList a) Source # 
Instance details

Defined in Plutarch.Builtin

Methods

pfromDataImpl :: forall (s :: S). Term s (PAsData (PBuiltinList a)) -> Term s (PBuiltinList a) Source #

pdataImpl :: forall (s :: S). Term s (PBuiltinList a) -> Term s PData Source #

PIsData (PDataNewtype a) Source #

Since: 1.7.0

Instance details

Defined in Plutarch.Builtin

Methods

pfromDataImpl :: forall (s :: S). Term s (PAsData (PDataNewtype a)) -> Term s (PDataNewtype a) Source #

pdataImpl :: forall (s :: S). Term s (PDataNewtype a) -> Term s PData Source #

PIsData (PDataRecord xs) Source # 
Instance details

Defined in Plutarch.DataRepr.Internal

Methods

pfromDataImpl :: forall (s :: S). Term s (PAsData (PDataRecord xs)) -> Term s (PDataRecord xs) Source #

pdataImpl :: forall (s :: S). Term s (PDataRecord xs) -> Term s PData Source #

PIsData (PDataSum defs) Source # 
Instance details

Defined in Plutarch.DataRepr.Internal

Methods

pfromDataImpl :: forall (s :: S). Term s (PAsData (PDataSum defs)) -> Term s (PDataSum defs) Source #

pdataImpl :: forall (s :: S). Term s (PDataSum defs) -> Term s PData Source #

PIsData (PUnit :: S -> Type) Source # 
Instance details

Defined in Plutarch.Builtin

Methods

pfromDataImpl :: forall (s :: S). Term s (PAsData PUnit) -> Term s PUnit Source #

pdataImpl :: forall (s :: S). Term s PUnit -> Term s PData Source #

PIsData (PBuiltinPair (PAsData a) (PAsData b)) Source # 
Instance details

Defined in Plutarch.Builtin

Methods

pfromDataImpl :: forall (s :: S). Term s (PAsData (PBuiltinPair (PAsData a) (PAsData b))) -> Term s (PBuiltinPair (PAsData a) (PAsData b)) Source #

pdataImpl :: forall (s :: S). Term s (PBuiltinPair (PAsData a) (PAsData b)) -> Term s PData Source #

PIsData (PBuiltinPair PData PData) Source # 
Instance details

Defined in Plutarch.Builtin

PIsData (PBuiltinPair PInteger (PBuiltinList PData)) Source # 
Instance details

Defined in Plutarch.Builtin

PIsData (PEitherData a b) Source #

@since WIP

Instance details

Defined in Plutarch.Either

Methods

pfromDataImpl :: forall (s :: S). Term s (PAsData (PEitherData a b)) -> Term s (PEitherData a b) Source #

pdataImpl :: forall (s :: S). Term s (PEitherData a b) -> Term s PData Source #

pdata :: PIsData a => Term s a -> Term s (PAsData a) Source #

pfromData :: PIsData a => Term s (PAsData a) -> Term s a Source #

data PAsData (a :: S -> Type) (s :: S) Source #

Instances

Instances details
PFromDataable a (PAsData a) Source # 
Instance details

Defined in Plutarch.DataRepr.Internal.FromData

Methods

pmaybeFromAsData :: forall (s :: S). Term s (PAsData a) -> Term s (PAsData a) Source #

(PTryFrom PData (PAsData a), PIsData a) => PTryFrom PData (PAsData (PBuiltinList (PAsData a))) Source #

Recover a `PBuiltinList (PAsData a)`

Instance details

Defined in Plutarch.Builtin

Associated Types

type PTryFromExcess PData (PAsData (PBuiltinList (PAsData a))) :: PType Source #

Methods

ptryFrom' :: forall (s :: S) (r :: PType). Term s PData -> ((Term s (PAsData (PBuiltinList (PAsData a))), Reduce (PTryFromExcess PData (PAsData (PBuiltinList (PAsData a))) s)) -> Term s r) -> Term s r Source #

PTryFrom PData (PAsData (PBuiltinList PData)) Source #

This verifies a list to be indeed a list but doesn't recover the inner data use this instance instead of the one for `PData (PAsData (PBuiltinList (PAsData a)))` as this is O(1) instead of O(n)

Instance details

Defined in Plutarch.Builtin

Methods

ptryFrom' :: forall (s :: S) (r :: PType). Term s PData -> ((Term s (PAsData (PBuiltinList PData)), Reduce (PTryFromExcess PData (PAsData (PBuiltinList PData)) s)) -> Term s r) -> Term s r Source #

(PTryFrom PData a, a ~ PAsData a', PIsData a', PTryFrom PData b, b ~ PAsData b', PIsData b') => PTryFrom PData (PAsData (PBuiltinPair a b)) Source #

Recover a `PAsData (PBuiltinPair a b)`

Instance details

Defined in Plutarch.Builtin

Associated Types

type PTryFromExcess PData (PAsData (PBuiltinPair a b)) :: PType Source #

Methods

ptryFrom' :: forall (s :: S) (r :: PType). Term s PData -> ((Term s (PAsData (PBuiltinPair a b)), Reduce (PTryFromExcess PData (PAsData (PBuiltinPair a b)) s)) -> Term s r) -> Term s r Source #

PTryFrom PData (PAsData PData) Source # 
Instance details

Defined in Plutarch.Builtin

Associated Types

type PTryFromExcess PData (PAsData PData) :: PType Source #

Methods

ptryFrom' :: forall (s :: S) (r :: PType). Term s PData -> ((Term s (PAsData PData), Reduce (PTryFromExcess PData (PAsData PData) s)) -> Term s r) -> Term s r Source #

PTryFrom PData (PAsData (PDataNewtype a)) Source #

Since: 1.7.0

Instance details

Defined in Plutarch.Builtin

Associated Types

type PTryFromExcess PData (PAsData (PDataNewtype a)) :: PType Source #

Methods

ptryFrom' :: forall (s :: S) (r :: PType). Term s PData -> ((Term s (PAsData (PDataNewtype a)), Reduce (PTryFromExcess PData (PAsData (PDataNewtype a)) s)) -> Term s r) -> Term s r Source #

PTryFrom PData (PAsData PBool) Source #

Since: 1.7.0

Instance details

Defined in Plutarch.Builtin

Associated Types

type PTryFromExcess PData (PAsData PBool) :: PType Source #

Methods

ptryFrom' :: forall (s :: S) (r :: PType). Term s PData -> ((Term s (PAsData PBool), Reduce (PTryFromExcess PData (PAsData PBool) s)) -> Term s r) -> Term s r Source #

PTryFrom PData (PAsData PByteString) Source # 
Instance details

Defined in Plutarch.Builtin

Methods

ptryFrom' :: forall (s :: S) (r :: PType). Term s PData -> ((Term s (PAsData PByteString), Reduce (PTryFromExcess PData (PAsData PByteString) s)) -> Term s r) -> Term s r Source #

(PTryFrom (PBuiltinList PData) (PDataRecord as), PTryFromExcess (PBuiltinList PData) (PDataRecord as) ~ HRecP ase) => PTryFrom PData (PAsData (PDataRecord as)) Source # 
Instance details

Defined in Plutarch.DataRepr.Internal

Associated Types

type PTryFromExcess PData (PAsData (PDataRecord as)) :: PType Source #

Methods

ptryFrom' :: forall (s :: S) (r :: PType). Term s PData -> ((Term s (PAsData (PDataRecord as)), Reduce (PTryFromExcess PData (PAsData (PDataRecord as)) s)) -> Term s r) -> Term s r Source #

PTryFrom PData (PDataSum ys) => PTryFrom PData (PAsData (PDataSum ys)) Source # 
Instance details

Defined in Plutarch.DataRepr.Internal

Associated Types

type PTryFromExcess PData (PAsData (PDataSum ys)) :: PType Source #

Methods

ptryFrom' :: forall (s :: S) (r :: PType). Term s PData -> ((Term s (PAsData (PDataSum ys)), Reduce (PTryFromExcess PData (PAsData (PDataSum ys)) s)) -> Term s r) -> Term s r Source #

(PTryFrom PData a, PTryFrom PData b) => PTryFrom PData (PAsData (PEitherData a b)) Source #

@since WIP

Instance details

Defined in Plutarch.Either

Associated Types

type PTryFromExcess PData (PAsData (PEitherData a b)) :: PType Source #

Methods

ptryFrom' :: forall (s :: S) (r :: PType). Term s PData -> ((Term s (PAsData (PEitherData a b)), Reduce (PTryFromExcess PData (PAsData (PEitherData a b)) s)) -> Term s r) -> Term s r Source #

PTryFrom PData (PAsData PInteger) Source # 
Instance details

Defined in Plutarch.Builtin

Associated Types

type PTryFromExcess PData (PAsData PInteger) :: PType Source #

Methods

ptryFrom' :: forall (s :: S) (r :: PType). Term s PData -> ((Term s (PAsData PInteger), Reduce (PTryFromExcess PData (PAsData PInteger) s)) -> Term s r) -> Term s r Source #

PTryFrom PData (PAsData PPositive) Source # 
Instance details

Defined in Plutarch.Positive

Associated Types

type PTryFromExcess PData (PAsData PPositive) :: PType Source #

Methods

ptryFrom' :: forall (s :: S) (r :: PType). Term s PData -> ((Term s (PAsData PPositive), Reduce (PTryFromExcess PData (PAsData PPositive) s)) -> Term s r) -> Term s r Source #

PTryFrom PData (PAsData PRational) Source #

NOTE: This instance produces a verified PPositive as the excess output.

Instance details

Defined in Plutarch.Rational

Associated Types

type PTryFromExcess PData (PAsData PRational) :: PType Source #

Methods

ptryFrom' :: forall (s :: S) (r :: PType). Term s PData -> ((Term s (PAsData PRational), Reduce (PTryFromExcess PData (PAsData PRational) s)) -> Term s r) -> Term s r Source #

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

Defined in Plutarch.DataRepr.Internal.Field

Associated Types

type PFields (PAsData a) :: [PLabeledType] Source #

Methods

ptoFields :: forall (s :: S). Term s (PAsData a) -> Term s (PDataRecord (PFields (PAsData a))) Source #

PEq (PAsData a) Source # 
Instance details

Defined in Plutarch.Builtin

Methods

(#==) :: forall (s :: S). Term s (PAsData a) -> Term s (PAsData a) -> Term s PBool Source #

PLiftable (PAsData PData) Source # 
Instance details

Defined in Plutarch.Builtin

Associated Types

type AsHaskell (PAsData PData) Source #

type PlutusRepr (PAsData PData) Source #

PLiftable (PAsData PByteString) Source # 
Instance details

Defined in Plutarch.Builtin

(ToData (AsHaskell a), FromData (AsHaskell a), PIsData a) => PLiftable (PAsData a) Source # 
Instance details

Defined in Plutarch.Builtin

Associated Types

type AsHaskell (PAsData a) Source #

type PlutusRepr (PAsData a) Source #

PIsData a => PlutusType (PAsData a) Source # 
Instance details

Defined in Plutarch.Builtin

Associated Types

type PInner (PAsData a) :: PType Source #

type PCovariant' (PAsData a) Source #

type PContravariant' (PAsData a) Source #

type PVariant' (PAsData a) Source #

Methods

pcon' :: forall (s :: S). PAsData a s -> Term s (PInner (PAsData a)) Source #

pmatch' :: forall (s :: S) (b :: PType). Term s (PInner (PAsData a)) -> (PAsData a s -> Term s b) -> Term s b Source #

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

Defined in Plutarch.Builtin

Methods

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

PIsData (PBuiltinPair (PAsData a) (PAsData b)) Source # 
Instance details

Defined in Plutarch.Builtin

Methods

pfromDataImpl :: forall (s :: S). Term s (PAsData (PBuiltinPair (PAsData a) (PAsData b))) -> Term s (PBuiltinPair (PAsData a) (PAsData b)) Source #

pdataImpl :: forall (s :: S). Term s (PBuiltinPair (PAsData a) (PAsData b)) -> Term s PData Source #

type PTryFromExcess PData (PAsData (PBuiltinList (PAsData a))) Source # 
Instance details

Defined in Plutarch.Builtin

type PTryFromExcess PData (PAsData (PBuiltinList PData)) Source # 
Instance details

Defined in Plutarch.Builtin

type PTryFromExcess PData (PAsData (PBuiltinPair a b)) Source # 
Instance details

Defined in Plutarch.Builtin

type PTryFromExcess PData (PAsData PData) Source # 
Instance details

Defined in Plutarch.Builtin

type PTryFromExcess PData (PAsData (PDataNewtype a)) Source # 
Instance details

Defined in Plutarch.Builtin

type PTryFromExcess PData (PAsData PBool) Source # 
Instance details

Defined in Plutarch.Builtin

type PTryFromExcess PData (PAsData PByteString) Source # 
Instance details

Defined in Plutarch.Builtin

type PTryFromExcess PData (PAsData (PDataRecord as)) Source # 
Instance details

Defined in Plutarch.DataRepr.Internal

type PTryFromExcess PData (PAsData (PDataSum ys)) Source # 
Instance details

Defined in Plutarch.DataRepr.Internal

type PTryFromExcess PData (PAsData (PEitherData a b)) Source # 
Instance details

Defined in Plutarch.Either

type PTryFromExcess PData (PAsData PInteger) Source # 
Instance details

Defined in Plutarch.Builtin

type PTryFromExcess PData (PAsData PPositive) Source # 
Instance details

Defined in Plutarch.Positive

type PTryFromExcess PData (PAsData PRational) Source # 
Instance details

Defined in Plutarch.Rational

type PFields (PAsData a) Source # 
Instance details

Defined in Plutarch.DataRepr.Internal.Field

type PFields (PAsData a) = PFields a
type AsHaskell (PAsData PData) Source # 
Instance details

Defined in Plutarch.Builtin

type AsHaskell (PAsData PByteString) Source # 
Instance details

Defined in Plutarch.Builtin

type AsHaskell (PAsData a) Source # 
Instance details

Defined in Plutarch.Builtin

type PlutusRepr (PAsData PData) Source # 
Instance details

Defined in Plutarch.Builtin

type PlutusRepr (PAsData PData) = Data
type PlutusRepr (PAsData PByteString) Source # 
Instance details

Defined in Plutarch.Builtin

type PlutusRepr (PAsData a) Source # 
Instance details

Defined in Plutarch.Builtin

type PlutusRepr (PAsData a) = Data
type PContravariant' (PAsData a) Source # 
Instance details

Defined in Plutarch.Builtin

type PCovariant' (PAsData a) Source # 
Instance details

Defined in Plutarch.Builtin

type PInner (PAsData a) Source # 
Instance details

Defined in Plutarch.Builtin

type PInner (PAsData a)
type PVariant' (PAsData a) Source # 
Instance details

Defined in Plutarch.Builtin

pforgetData :: forall s a. Term s (PAsData a) -> Term s PData Source #

prememberData :: forall (p :: (S -> Type) -> S -> Type) (s :: S). PVariant p => Proxy p -> Term s (p PData) -> Term s (p (PAsData PData)) Source #

Inverse of pforgetData'.

prememberData' :: forall a (p :: (S -> Type) -> S -> Type) (s :: S). (PSubtype PData a, PVariant p) => Proxy p -> Term s (p a) -> Term s (p (PAsData a)) Source #

Like prememberData but generalised.

pserialiseData :: Term s (PData :--> PByteString) Source #

Serialise any builtin data to its cbor represented by a builtin bytestring

ppairDataBuiltin :: Term s (PAsData a :--> (PAsData b :--> PBuiltinPair (PAsData a) (PAsData b))) Source #

Construct a builtin pair of PData elements.

Uses PAsData to preserve more information about the underlying PData.

pchooseData :: Term s (PData :--> (a :--> (a :--> (a :--> (a :--> (a :--> a)))))) Source #

newtype PDataNewtype (a :: S -> Type) (s :: S) Source #

Since: 1.7.0

Constructors

PDataNewtype (Term s (PAsData a)) 

Instances

Instances details
PTryFrom PData (PAsData (PDataNewtype a)) Source #

Since: 1.7.0

Instance details

Defined in Plutarch.Builtin

Associated Types

type PTryFromExcess PData (PAsData (PDataNewtype a)) :: PType Source #

Methods

ptryFrom' :: forall (s :: S) (r :: PType). Term s PData -> ((Term s (PAsData (PDataNewtype a)), Reduce (PTryFromExcess PData (PAsData (PDataNewtype a)) s)) -> Term s r) -> Term s r Source #

(PIsData a, PTryFrom PData (PAsData a)) => PTryFrom PData (PDataNewtype a) Source #

Since: 1.7.0

Instance details

Defined in Plutarch.Builtin

Associated Types

type PTryFromExcess PData (PDataNewtype a) :: PType Source #

Methods

ptryFrom' :: forall (s :: S) (r :: PType). Term s PData -> ((Term s (PDataNewtype a), Reduce (PTryFromExcess PData (PDataNewtype a) s)) -> Term s r) -> Term s r Source #

PIsData (PDataNewtype a) Source #

Since: 1.7.0

Instance details

Defined in Plutarch.Builtin

Methods

pfromDataImpl :: forall (s :: S). Term s (PAsData (PDataNewtype a)) -> Term s (PDataNewtype a) Source #

pdataImpl :: forall (s :: S). Term s (PDataNewtype a) -> Term s PData Source #

PEq (PDataNewtype a) Source #

Since: 1.7.0

Instance details

Defined in Plutarch.Builtin

Methods

(#==) :: forall (s :: S). Term s (PDataNewtype a) -> Term s (PDataNewtype a) -> Term s PBool Source #

(PIsData a, PPartialOrd a) => POrd (PDataNewtype a) Source #

Since: 1.7.0

Instance details

Defined in Plutarch.Builtin

Methods

pmax :: forall (s :: S). Term s (PDataNewtype a) -> Term s (PDataNewtype a) -> Term s (PDataNewtype a) Source #

pmin :: forall (s :: S). Term s (PDataNewtype a) -> Term s (PDataNewtype a) -> Term s (PDataNewtype a) Source #

(PIsData a, PPartialOrd a) => PPartialOrd (PDataNewtype a) Source #

Since: 1.7.0

Instance details

Defined in Plutarch.Builtin

Methods

(#<=) :: forall (s :: S). Term s (PDataNewtype a) -> Term s (PDataNewtype a) -> Term s PBool Source #

(#<) :: forall (s :: S). Term s (PDataNewtype a) -> Term s (PDataNewtype a) -> Term s PBool Source #

(#>=) :: forall (s :: S). Term s (PDataNewtype a) -> Term s (PDataNewtype a) -> Term s PBool Source #

(#>) :: forall (s :: S). Term s (PDataNewtype a) -> Term s (PDataNewtype a) -> Term s PBool Source #

PlutusType (PDataNewtype a) Source #

Since: 1.7.0

Instance details

Defined in Plutarch.Builtin

Methods

pcon' :: forall (s :: S). PDataNewtype a s -> Term s (PInner (PDataNewtype a)) Source #

pmatch' :: forall (s :: S) (b :: PType). Term s (PInner (PDataNewtype a)) -> (PDataNewtype a s -> Term s b) -> Term s b Source #

(PIsData a, PShow a) => PShow (PDataNewtype a) Source #

Since: 1.7.0

Instance details

Defined in Plutarch.Builtin

Methods

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

Generic (PDataNewtype a s) Source # 
Instance details

Defined in Plutarch.Builtin

Associated Types

type Rep (PDataNewtype a s) :: Type -> Type Source #

Methods

from :: PDataNewtype a s -> Rep (PDataNewtype a s) x Source #

to :: Rep (PDataNewtype a s) x -> PDataNewtype a s Source #

type PTryFromExcess PData (PAsData (PDataNewtype a)) Source # 
Instance details

Defined in Plutarch.Builtin

type PTryFromExcess PData (PDataNewtype a) Source # 
Instance details

Defined in Plutarch.Builtin

type PContravariant' (PDataNewtype a) Source # 
Instance details

Defined in Plutarch.Builtin

type PCovariant' (PDataNewtype a) Source # 
Instance details

Defined in Plutarch.Builtin

type PInner (PDataNewtype a) Source # 
Instance details

Defined in Plutarch.Builtin

type PVariant' (PDataNewtype a) Source # 
Instance details

Defined in Plutarch.Builtin

type Rep (PDataNewtype a s) Source #

Since: 1.7.0

Instance details

Defined in Plutarch.Builtin

type Rep (PDataNewtype a s) = D1 ('MetaData "PDataNewtype" "Plutarch.Builtin" "plutarch-1.9.0-DaxzFvLNVysDL1hkJ4YFrw" 'True) (C1 ('MetaCons "PDataNewtype" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Term s (PAsData a)))))