plutarch-1.9.0
Safe HaskellSafe-Inferred
LanguageGHC2021

Plutarch.Internal.IsData

Synopsis

Documentation

class PIsData a Source #

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

Instances

Instances details
PIsData PBool Source # 
Instance details

Defined in Plutarch.Internal.IsData

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.Internal.IsData

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 PData Source # 
Instance details

Defined in Plutarch.Internal.IsData

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 PInteger Source # 
Instance details

Defined in Plutarch.Internal.IsData

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 PUnit Source # 
Instance details

Defined in Plutarch.Internal.IsData

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 PPositive Source #

@since WIP

Instance details

Defined in Plutarch.Internal.Numeric

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 (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 #

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

Defined in Plutarch.Internal.IsData

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 (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 (PDataRec struct) Source #

@since WIP

Instance details

Defined in Plutarch.Repr.Data

Methods

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

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

PIsData (PDataStruct struct) Source #

@since WIP

Instance details

Defined in Plutarch.Repr.Data

Methods

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

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

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

Defined in Plutarch.Internal.IsData

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.Internal.IsData

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

Defined in Plutarch.Internal.IsData

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 #

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'.

pforgetData' :: forall a (p :: (S -> Type) -> S -> Type) (s :: S). PCovariant p => Proxy p -> Term s (p (PAsData a)) -> Term s (p PData) Source #

Like pforgetData, except it works for complex types. Equivalent to pupcastF.

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.