Skip to content
This repository has been archived by the owner on Aug 26, 2022. It is now read-only.

Latest commit

 

History

History
17 lines (11 loc) · 806 Bytes

PTuple.md

File metadata and controls

17 lines (11 loc) · 806 Bytes

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)))