| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
PlutusCore.Evaluation.Machine.Ck
Description
The CK machine.
Synopsis
- data EvaluationResult a
- type CkEvaluationException (uni :: Type -> Type) fun = EvaluationException (MachineError fun) CkUserError (Term TyName Name uni fun ())
- type CkM (uni :: Type -> Type) fun s = ReaderT (CkEnv uni fun s) (ExceptT (CkEvaluationException uni fun) (ST s))
- data CkValue (uni :: Type -> Type) fun
- runCk :: forall fun (uni :: Type -> Type). BuiltinsRuntime fun (CkValue uni fun) -> CaserBuiltin uni -> 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 :: forall fun (uni :: Type -> Type). BuiltinsRuntime fun (CkValue uni fun) -> CaserBuiltin uni -> Term TyName Name uni fun () -> (Either (CkEvaluationException uni fun) (Term TyName Name uni fun ()), [Text])
- evaluateCkNoEmit :: forall fun (uni :: Type -> Type). BuiltinsRuntime fun (CkValue uni fun) -> CaserBuiltin uni -> Term TyName Name uni fun () -> Either (CkEvaluationException uni fun) (Term TyName Name uni fun ())
- readKnownCk :: forall (uni :: Type -> Type) fun a. ReadKnown (Term TyName Name uni fun ()) a => BuiltinsRuntime fun (CkValue uni fun) -> CaserBuiltin uni -> Term TyName Name uni fun () -> Either (CkEvaluationException uni fun) a
Documentation
data EvaluationResult a Source #
The parameterized type of results various evaluation engines return.
Constructors
| EvaluationSuccess !a | |
| EvaluationFailure |
Instances
type CkEvaluationException (uni :: Type -> Type) fun = EvaluationException (MachineError fun) CkUserError (Term TyName Name uni fun ()) Source #
The CK machine-specific EvaluationException.
type CkM (uni :: Type -> Type) fun s = ReaderT (CkEnv uni fun s) (ExceptT (CkEvaluationException uni fun) (ST s)) Source #
data CkValue (uni :: Type -> Type) fun Source #
Instances
| (PrettyUni uni, Pretty fun) => PrettyBy PrettyConfigPlc (CkValue uni fun) Source # | |
Defined in PlutusCore.Evaluation.Machine.Ck Methods prettyBy :: PrettyConfigPlc -> CkValue uni fun -> Doc ann # prettyListBy :: PrettyConfigPlc -> [CkValue uni fun] -> Doc ann # | |
| 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 Methods memoryUsage :: CkValue uni fun -> CostRose Source # | |
| type UniOf (CkValue uni fun) Source # | |
Defined in PlutusCore.Evaluation.Machine.Ck | |
runCk :: forall fun (uni :: Type -> Type). BuiltinsRuntime fun (CkValue uni fun) -> CaserBuiltin uni -> 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 StructuralError as a Left and turn an
OperationalError 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 StructuralError and turn an OperationalError into an
EvaluationFailure (thus erasing the content of the error in the latter case).
evaluateCk :: forall fun (uni :: Type -> Type). BuiltinsRuntime fun (CkValue uni fun) -> CaserBuiltin uni -> 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 :: forall fun (uni :: Type -> Type). BuiltinsRuntime fun (CkValue uni fun) -> CaserBuiltin uni -> 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 :: forall (uni :: Type -> Type) fun a. ReadKnown (Term TyName Name uni fun ()) a => BuiltinsRuntime fun (CkValue uni fun) -> CaserBuiltin uni -> Term TyName Name uni fun () -> Either (CkEvaluationException uni fun) a Source #
Unlift a value using the CK machine.