Skip to content

Latest commit

 

History

History
29 lines (20 loc) · 948 Bytes

PTuple.md

File metadata and controls

29 lines (20 loc) · 948 Bytes
imports

module Plutarch.Docs.PTuple () where 
import Plutarch.Prelude ()

PTuple

These are data encoded pairs. You can build PTuples 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)))