Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
This module defines a common type various evaluation machine use to return their results.
Synopsis
- class AsEvaluationFailure err where
- _EvaluationFailure ∷ Prism' err ()
- evaluationFailure ∷ AsEvaluationFailure err ⇒ err
- _EvaluationFailureVia ∷ Eq err ⇒ err → Prism' err ()
- data EvaluationResult a
- isEvaluationSuccess ∷ EvaluationResult a → Bool
- isEvaluationFailure ∷ EvaluationResult a → Bool
Documentation
class AsEvaluationFailure err where Source #
A class for viewing errors as evaluation failures (in the sense of Plutus).
_EvaluationFailure ∷ Prism' err () Source #
Instances
evaluationFailure ∷ AsEvaluationFailure err ⇒ err Source #
_EvaluationFailureVia ∷ Eq err ⇒ err → Prism' err () Source #
Construct a prism focusing on the *EvaluationFailure
part of err
by taking
that *EvaluationFailure
and
- returning it for the setter part of the prism
- checking the error for equality with
*EvaluationFailure
for the opposite direction.
data EvaluationResult a Source #
The parameterized type of results various evaluation engines return.
On the PLC side this becomes (via makeKnown
) either a call to Error
or
a value of the PLC counterpart of type a
.
Instances
isEvaluationSuccess ∷ EvaluationResult a → Bool Source #
Check whether an EvaluationResult
is an EvaluationSuccess
.
isEvaluationFailure ∷ EvaluationResult a → Bool Source #
Check whether an EvaluationResult
is an EvaluationFailure
.