Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
TermCont-related adapters for Plutarch functions.
Synopsis
- pletC :: Term s a -> TermCont s (Term s a)
- pmatchC :: PlutusType a => Term s a -> TermCont s (a s)
- pletFieldsC :: forall fs a s b ps bs. (PDataFields a, ps ~ PFields a, bs ~ Bindings ps fs, BindFields ps bs) => Term s a -> TermCont @b s (HRec (BoundTerms ps bs s))
- ptraceC :: Term s PString -> TermCont s ()
- pguardC :: Term s PString -> Term s PBool -> TermCont s ()
- pguardC' :: Term s a -> Term s PBool -> TermCont @a s ()
- ptryFromC :: forall b r a s. PTryFrom a b => Term s a -> TermCont @r s (Term s b, Reduce (PTryFromExcess a b s))
Documentation
pletFieldsC :: forall fs a s b ps bs. (PDataFields a, ps ~ PFields a, bs ~ Bindings ps fs, BindFields ps bs) => Term s a -> TermCont @b s (HRec (BoundTerms ps bs s)) Source #
Like pletFields
but works in a TermCont
monad.
pguardC :: Term s PString -> Term s PBool -> TermCont s () Source #
Trace a message and raise error if cond
is false. Otherwise, continue.
Example ===
onlyAllow42 :: Term s (PInteger :--> PUnit) onlyAllow42 = plam $ i -> unTermCont $ do pguardC "expected 42" $ i #== 42 pure $ pconstant ()