Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
The CK machine.
Synopsis
- data EvaluationResult a
- type CkEvaluationException uni fun = EvaluationException (MachineError fun) CkUserError (Term TyName Name uni fun ())
- type CkM uni fun s = ReaderT (CkEnv uni fun s) (ExceptT (CkEvaluationException uni fun) (ST s))
- data CkValue uni fun
- runCk ∷ BuiltinsRuntime fun (CkValue uni fun) → Bool → Term TyName Name uni fun () → (Either (CkEvaluationException uni fun) (Term TyName Name uni fun ()), [Text])
- splitStructuralOperational ∷ Either (EvaluationException structural operational term) a → Either (ErrorWithCause structural term) (EvaluationResult a)
- unsafeSplitStructuralOperational ∷ (PrettyPlc structural, PrettyPlc term, Typeable structural, Typeable term) ⇒ Either (EvaluationException structural operational term) a → EvaluationResult a
- evaluateCk ∷ BuiltinsRuntime fun (CkValue uni fun) → Term TyName Name uni fun () → (Either (CkEvaluationException uni fun) (Term TyName Name uni fun ()), [Text])
- evaluateCkNoEmit ∷ BuiltinsRuntime fun (CkValue uni fun) → Term TyName Name uni fun () → Either (CkEvaluationException uni fun) (Term TyName Name uni fun ())
- readKnownCk ∷ ReadKnown (Term TyName Name uni fun ()) a ⇒ BuiltinsRuntime fun (CkValue uni fun) → Term TyName Name uni fun () → Either (CkEvaluationException uni fun) a
Documentation
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
type CkEvaluationException uni fun = EvaluationException (MachineError fun) CkUserError (Term TyName Name uni fun ()) Source #
The CK machine-specific EvaluationException
.
type CkM uni fun s = ReaderT (CkEnv uni fun s) (ExceptT (CkEvaluationException uni fun) (ST s)) Source #
Instances
(PrettyUni uni, Pretty fun) ⇒ PrettyBy PrettyConfigPlc (CkValue uni fun) Source # | |
Defined in PlutusCore.Evaluation.Machine.Ck prettyBy ∷ PrettyConfigPlc → CkValue uni fun → Doc ann Source # prettyListBy ∷ PrettyConfigPlc → [CkValue uni fun] → Doc ann Source # | |
Show (BuiltinRuntime (CkValue uni fun)) Source # | |
Defined in PlutusCore.Evaluation.Machine.Ck | |
(GShow uni, Everywhere uni Show, Show fun, Closed uni) ⇒ Show (CkValue uni fun) Source # | |
HasConstant (CkValue uni fun) Source # | |
Defined in PlutusCore.Evaluation.Machine.Ck | |
ExMemoryUsage (CkValue uni fun) Source # | |
Defined in PlutusCore.Evaluation.Machine.Ck memoryUsage ∷ CkValue uni fun → CostRose Source # | |
type UniOf (CkValue uni fun) Source # | |
Defined in PlutusCore.Evaluation.Machine.Ck |
runCk ∷ BuiltinsRuntime fun (CkValue uni fun) → Bool → Term TyName Name uni fun () → (Either (CkEvaluationException uni fun) (Term TyName Name uni fun ()), [Text]) Source #
splitStructuralOperational ∷ Either (EvaluationException structural operational term) a → Either (ErrorWithCause structural term) (EvaluationResult a) Source #
Preserve the contents of an StructuralEvaluationError
as a Left
and turn an
OperationalEvaluationError
into a Right EvaluationFailure
(thus erasing the content of the
error in the latter case).
unsafeSplitStructuralOperational ∷ (PrettyPlc structural, PrettyPlc term, Typeable structural, Typeable term) ⇒ Either (EvaluationException structural operational term) a → EvaluationResult a Source #
Throw on a StructuralEvaluationError
and turn an OperationalEvaluationError
into an
EvaluationFailure
(thus erasing the content of the error in the latter case).
evaluateCk ∷ BuiltinsRuntime fun (CkValue uni fun) → Term TyName Name uni fun () → (Either (CkEvaluationException uni fun) (Term TyName Name uni fun ()), [Text]) Source #
Evaluate a term using the CK machine with logging enabled.
evaluateCkNoEmit ∷ BuiltinsRuntime fun (CkValue uni fun) → Term TyName Name uni fun () → Either (CkEvaluationException uni fun) (Term TyName Name uni fun ()) Source #
Evaluate a term using the CK machine with logging disabled.
readKnownCk ∷ ReadKnown (Term TyName Name uni fun ()) a ⇒ BuiltinsRuntime fun (CkValue uni fun) → Term TyName Name uni fun () → Either (CkEvaluationException uni fun) a Source #
Unlift a value using the CK machine.