plutarch-1.9.0
Safe HaskellSafe-Inferred
LanguageGHC2021

Plutarch.DataRepr.Internal.FromData

Synopsis

Documentation

class PFromDataable (a :: PType) (b :: PType) | b -> a, a -> b Source #

removes the PAsData if the hole requires it but leaves it there if it doesn't

>>> :t pmaybeFromAsData (pdata 3 :: (Term s (PAsData PInteger))) :: (Term (s::S) PInteger)
pmaybeFromAsData (pdata 3 :: (Term s (PAsData PInteger))) :: (Term (s::S) PInteger)
:: forall (s :: S). Term s (PInteger @{S})
>>> :t pmaybeFromAsData (pdata 3 :: (Term s (PAsData PInteger))) :: (Term (s::S) (PAsData PInteger))
pmaybeFromAsData (pdata 3 :: (Term s (PAsData PInteger))) :: (Term (s::S) (PAsData PInteger))
:: forall (s :: S). Term s (PAsData (PInteger @{S}))

Minimal complete definition

pmaybeFromAsData

Instances

Instances details
(PIsData a, b ~ a) => PFromDataable a b Source # 
Instance details

Defined in Plutarch.DataRepr.Internal.FromData

Methods

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

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 #