plutarch-1.9.0
Safe HaskellSafe-Inferred
LanguageGHC2021

Plutarch.Builtin.Bool

Synopsis

Type

data PBool (s :: S) Source #

Builtin Plutus boolean.

@since WIP

Constructors

PTrue 
PFalse 

Instances

Instances details
PEq PBool Source # 
Instance details

Defined in Plutarch.Internal.Eq

Methods

(#==) :: forall (s :: S). Term s PBool -> Term s PBool -> Term s PBool Source #

PIsData PBool Source # 
Instance details

Defined in Plutarch.Internal.IsData

Methods

pfromDataImpl :: forall (s :: S). Term s (PAsData PBool) -> Term s PBool Source #

pdataImpl :: forall (s :: S). Term s PBool -> Term s PData Source #

PLiftable PBool Source # 
Instance details

Defined in Plutarch.Internal.Lift

Associated Types

type AsHaskell PBool Source #

type PlutusRepr PBool Source #

POrd PBool Source # 
Instance details

Defined in Plutarch.Internal.Ord

Methods

(#<=) :: forall (s :: S). Term s PBool -> Term s PBool -> Term s PBool Source #

(#<) :: forall (s :: S). Term s PBool -> Term s PBool -> Term s PBool Source #

pmax :: forall (s :: S). Term s PBool -> Term s PBool -> Term s PBool Source #

pmin :: forall (s :: S). Term s PBool -> Term s PBool -> Term s PBool Source #

PlutusType PBool Source #

@since WIP

Instance details

Defined in Plutarch.Internal.PlutusType

Methods

pcon' :: forall (s :: S). PBool s -> Term s (PInner PBool) Source #

pmatch' :: forall (s :: S) (b :: PType). Term s (PInner PBool) -> (PBool s -> Term s b) -> Term s b Source #

PShow PBool Source # 
Instance details

Defined in Plutarch.Internal.Show

Methods

pshow' :: forall (s :: S). Bool -> Term s PBool -> Term s PString Source #

PTryFrom PData (PAsData PBool) Source #

Since: 1.7.0

Instance details

Defined in Plutarch.Internal.TryFrom

Associated Types

type PTryFromExcess PData (PAsData PBool) :: PType Source #

Methods

ptryFrom' :: forall (s :: S) (r :: PType). Term s PData -> ((Term s (PAsData PBool), Reduce (PTryFromExcess PData (PAsData PBool) s)) -> Term s r) -> Term s r Source #

Show (PBool s) Source #

@since WIP

Instance details

Defined in Plutarch.Builtin.Bool

type AsHaskell PBool Source #

@since WIP

Instance details

Defined in Plutarch.Internal.Lift

type PlutusRepr PBool Source # 
Instance details

Defined in Plutarch.Internal.Lift

type PContravariant' PBool Source # 
Instance details

Defined in Plutarch.Internal.PlutusType

type PCovariant' PBool Source # 
Instance details

Defined in Plutarch.Internal.PlutusType

type PInner PBool Source # 
Instance details

Defined in Plutarch.Internal.PlutusType

type PVariant' PBool Source # 
Instance details

Defined in Plutarch.Internal.PlutusType

type PTryFromExcess PData (PAsData PBool) Source # 
Instance details

Defined in Plutarch.Internal.TryFrom

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

pnot :: forall (s :: S). Term s (PBool :--> PBool) Source #

Boolean negation.

@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

por' :: Term s (PBool :--> (PBool :--> PBool)) Source #

As por, 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 pifs, 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

ptrue :: Term (s :: S) PBool Source #