imports
module Plutarch.Docs.PTuple () where
import Plutarch.Prelude ()
These are data encoded pairs. You can build PTuple
s using ptuple
:
ptuple :: Term s (PAsData a :--> PAsData b :--> PTuple a b)
PTuple
has a PDataFields
instance. As such, you can extract its fields using pletFields
or pfield
.
Since PAsData (PBuiltinPair (PAsData a) (PAsData b))
and PAsData (PTuple a b)
have the same representation - you can safely convert between them at no cost:
ptupleFromBuiltin :: Term s (PAsData (PBuiltinPair (PAsData a) (PAsData b))) -> Term s (PAsData (PTuple a b))
pbuiltinPairFromTuple :: Term s (PAsData (PTuple a b)) -> Term s (PAsData (PBuiltinPair (PAsData a) (PAsData b)))