Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
PlutusCore.Generators.Hedgehog.TypeEvalCheck
Description
This module defines types and functions related to "type-eval checking".
Synopsis
- data TypeEvalCheckError uni fun
- = TypeEvalCheckErrorIllFormed !(Error uni fun ())
- | TypeEvalCheckErrorIllTyped !(Normalized (Type TyName uni ())) !(Normalized (Type TyName uni ()))
- | TypeEvalCheckErrorException !String
- | TypeEvalCheckErrorIllEvaled !(EvaluationResult (HeadSpine (Term TyName Name uni fun ()))) !(EvaluationResult (Term TyName Name uni fun ()))
- data TypeEvalCheckResult uni fun = TypeEvalCheckResult {
- _termCheckResultType ∷ Normalized (Type TyName uni ())
- _termCheckResultValue ∷ EvaluationResult (Term TyName Name uni fun ())
- type TypeEvalCheckM uni fun = Either (TypeEvalCheckError uni fun)
- typeEvalCheckBy ∷ (uni ~ DefaultUni, fun ~ DefaultFun, KnownTypeAst TyName uni a, MakeKnown (Term TyName Name uni fun ()) a, PrettyPlc structural) ⇒ (Term TyName Name uni fun () → Either (EvaluationException structural operational (Term TyName Name uni fun ())) (Term TyName Name uni fun ())) → TermOf (Term TyName Name uni fun ()) a → TypeEvalCheckM uni fun (TermOf (Term TyName Name uni fun ()) (TypeEvalCheckResult uni fun))
- unsafeTypeEvalCheck ∷ (uni ~ DefaultUni, fun ~ DefaultFun, KnownTypeAst TyName uni a, MakeKnown (Term TyName Name uni fun ()) a) ⇒ TermOf (Term TyName Name uni fun ()) a → TermOf (Term TyName Name uni fun ()) (EvaluationResult (Term TyName Name uni fun ()))
Documentation
data TypeEvalCheckError uni fun Source #
The type of errors that can occur during type-eval checking.
Constructors
TypeEvalCheckErrorIllFormed !(Error uni fun ()) | |
TypeEvalCheckErrorIllTyped !(Normalized (Type TyName uni ())) !(Normalized (Type TyName uni ())) | |
TypeEvalCheckErrorException !String | |
TypeEvalCheckErrorIllEvaled !(EvaluationResult (HeadSpine (Term TyName Name uni fun ()))) !(EvaluationResult (Term TyName Name uni fun ())) | The former is an expected result of evaluation, the latter -- is an actual one. |
Instances
(PrettyBy config (Type TyName uni ()), PrettyBy config (Term TyName Name uni fun ()), PrettyBy config (HeadSpine (Term TyName Name uni fun ())), PrettyBy config (Error uni fun ())) ⇒ PrettyBy config (TypeEvalCheckError uni fun) Source # | |
Defined in PlutusCore.Generators.Hedgehog.TypeEvalCheck Methods prettyBy ∷ config → TypeEvalCheckError uni fun → Doc ann Source # prettyListBy ∷ config → [TypeEvalCheckError uni fun] → Doc ann Source # |
data TypeEvalCheckResult uni fun Source #
Type-eval checking of a term results in a value of this type.
Constructors
TypeEvalCheckResult | |
Fields
|
type TypeEvalCheckM uni fun = Either (TypeEvalCheckError uni fun) Source #
The monad type-eval checking runs in.
Arguments
∷ (uni ~ DefaultUni, fun ~ DefaultFun, KnownTypeAst TyName uni a, MakeKnown (Term TyName Name uni fun ()) a, PrettyPlc structural) | |
⇒ (Term TyName Name uni fun () → Either (EvaluationException structural operational (Term TyName Name uni fun ())) (Term TyName Name uni fun ())) | An evaluator. |
→ TermOf (Term TyName Name uni fun ()) a | |
→ TypeEvalCheckM uni fun (TermOf (Term TyName Name uni fun ()) (TypeEvalCheckResult uni fun)) |
Type check and evaluate a term and check that the expected result is equal to the actual one.
unsafeTypeEvalCheck ∷ (uni ~ DefaultUni, fun ~ DefaultFun, KnownTypeAst TyName uni a, MakeKnown (Term TyName Name uni fun ()) a) ⇒ TermOf (Term TyName Name uni fun ()) a → TermOf (Term TyName Name uni fun ()) (EvaluationResult (Term TyName Name uni fun ())) Source #
Type check and evaluate a term and check that the expected result is equal to the actual one. Throw an error in case something goes wrong.