Safe Haskell | None |
---|---|
Language | Haskell2010 |
The CK machine.
Synopsis
- data EvaluationResult a
- type CkEvaluationException uni fun = EvaluationException CkUserError ( MachineError fun) ( 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
- extractEvaluationResult :: Either ( EvaluationException user internal term) a -> Either ( ErrorWithCause internal term) ( EvaluationResult a)
- runCk :: Ix fun => BuiltinsRuntime fun ( CkValue uni fun) -> Bool -> Term TyName Name uni fun () -> ( Either ( CkEvaluationException uni fun) ( Term TyName Name uni fun ()), [ Text ])
- evaluateCk :: Ix fun => BuiltinsRuntime fun ( CkValue uni fun) -> Term TyName Name uni fun () -> ( Either ( CkEvaluationException uni fun) ( Term TyName Name uni fun ()), [ Text ])
- evaluateCkNoEmit :: Ix fun => BuiltinsRuntime fun ( CkValue uni fun) -> Term TyName Name uni fun () -> Either ( CkEvaluationException uni fun) ( Term TyName Name uni fun ())
- unsafeEvaluateCk :: ( GShow uni, Closed uni, Typeable uni, Typeable fun, uni `Everywhere` PrettyConst , Pretty fun, Ix fun) => BuiltinsRuntime fun ( CkValue uni fun) -> Term TyName Name uni fun () -> ( EvaluationResult ( Term TyName Name uni fun ()), [ Text ])
- unsafeEvaluateCkNoEmit :: ( GShow uni, Closed uni, Typeable uni, Typeable fun, uni `Everywhere` PrettyConst , Pretty fun, Ix fun) => BuiltinsRuntime fun ( CkValue uni fun) -> Term TyName Name uni fun () -> EvaluationResult ( Term TyName Name uni fun ())
- readKnownCk :: ( Ix fun, 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 CkUserError ( MachineError fun) ( 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
( Closed uni, GShow uni, Everywhere uni PrettyConst , 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 |
|
( Everywhere uni Show , GShow uni, Closed uni, Show fun) => Show ( CkValue uni fun) Source # | |
HasConstant ( CkValue uni fun) Source # | |
Defined in PlutusCore.Evaluation.Machine.Ck asConstant :: AsUnliftingError err => Maybe cause -> CkValue uni fun -> Either ( ErrorWithCause err cause) ( Some ( ValueOf ( UniOf ( CkValue uni fun)))) Source # fromConstant :: Some ( ValueOf ( UniOf ( CkValue uni fun))) -> CkValue uni fun Source # |
|
type UniOf ( CkValue uni fun) Source # | |
Defined in PlutusCore.Evaluation.Machine.Ck |
extractEvaluationResult :: Either ( EvaluationException user internal term) a -> Either ( ErrorWithCause internal term) ( EvaluationResult a) Source #
Turn any
UserEvaluationError
into an
EvaluationFailure
.
runCk :: Ix fun => BuiltinsRuntime fun ( CkValue uni fun) -> Bool -> Term TyName Name uni fun () -> ( Either ( CkEvaluationException uni fun) ( Term TyName Name uni fun ()), [ Text ]) Source #
evaluateCk :: Ix fun => 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 :: Ix fun => 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.
unsafeEvaluateCk :: ( GShow uni, Closed uni, Typeable uni, Typeable fun, uni `Everywhere` PrettyConst , Pretty fun, Ix fun) => BuiltinsRuntime fun ( CkValue uni fun) -> Term TyName Name uni fun () -> ( EvaluationResult ( Term TyName Name uni fun ()), [ Text ]) Source #
Evaluate a term using the CK machine with logging enabled. May throw a
CkEvaluationException
.
unsafeEvaluateCkNoEmit :: ( GShow uni, Closed uni, Typeable uni, Typeable fun, uni `Everywhere` PrettyConst , Pretty fun, Ix fun) => BuiltinsRuntime fun ( CkValue uni fun) -> Term TyName Name uni fun () -> EvaluationResult ( Term TyName Name uni fun ()) Source #
Evaluate a term using the CK machine with logging disabled. May throw a
CkEvaluationException
.
readKnownCk :: ( Ix fun, 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.