Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Synopsis
- data PBool (s :: S)
- pbuiltinIfThenElse :: forall (a :: S -> Type) (s :: S). Term s (PBool :--> (a :--> (a :--> PDelayed a)))
- pif' :: forall (a :: S -> Type) (s :: S). Term s (PBool :--> (a :--> (a :--> a)))
- pif :: forall (a :: S -> Type) (s :: S). Term s PBool -> Term s a -> Term s a -> Term s a
- pnot :: forall (s :: S). Term s (PBool :--> PBool)
- (#&&) :: forall (s :: S). Term s PBool -> Term s PBool -> Term s PBool
- (#||) :: forall (s :: S). Term s PBool -> Term s PBool -> Term s PBool
- por :: forall (s :: S). Term s (PBool :--> (PDelayed PBool :--> PDelayed PBool))
- pand :: forall (s :: S). Term s (PBool :--> (PDelayed PBool :--> PDelayed PBool))
- pand' :: forall (s :: S). Term s (PBool :--> (PBool :--> PBool))
- por' :: Term s (PBool :--> (PBool :--> PBool))
- pcond :: forall (a :: S -> Type) (s :: S). [(Term s PBool, Term s a)] -> Term s a -> Term s a
- ptrue :: Term (s :: S) PBool
- pfalse :: Term (s :: S) PBool
Type
Builtin Plutus boolean.
@since WIP
Instances
Builtin
pbuiltinIfThenElse :: forall (a :: S -> Type) (s :: S). Term s (PBool :--> (a :--> (a :--> PDelayed a))) Source #
@since WIP
Functions
pif' :: forall (a :: S -> Type) (s :: S). Term s (PBool :--> (a :--> (a :--> a))) Source #
Strict if-then-else. Emits slightly less code than the lazy version.
@since WIP
pif :: forall (a :: S -> Type) (s :: S). Term s PBool -> Term s a -> Term s a -> Term s a Source #
Lazy if-then-else.
@since WIP
(#&&) :: forall (s :: S). Term s PBool -> Term s PBool -> Term s PBool infixr 3 Source #
Lazy AND for terms.
@since WIP
(#||) :: forall (s :: S). Term s PBool -> Term s PBool -> Term s PBool infixr 2 Source #
Lazy OR for terms.
@since WIP
por :: forall (s :: S). Term s (PBool :--> (PDelayed PBool :--> PDelayed PBool)) Source #
Hoisted lazy OR at the Plutarch level.
@since WIP
pand :: forall (s :: S). Term s (PBool :--> (PDelayed PBool :--> PDelayed PBool)) Source #
Hoisted lazy AND at the Plutarch level.
@since WIP
pand' :: forall (s :: S). Term s (PBool :--> (PBool :--> PBool)) Source #
As pand
, but strict.
@since WIP
pcond :: forall (a :: S -> Type) (s :: S). [(Term s PBool, Term s a)] -> Term s a -> Term s a Source #
Essentially multi-way pif
. More precisely, given a list of
condition-action pairs, and an 'action of last resort', construct a
left-to-right 'chain' of pif
s, using the conditions to determine which
action gets taken. The 'action of last resort' finishes the 'chain'. For
example:
pcond [(cond1, act1), (cond2, act2)] act3
does the same thing as
pif cond1 act1 (pif cond2 act2 act3)
@since WIP