plutus-core-1.36.0.0: Language library for Plutus Core
Safe HaskellSafe-Inferred
LanguageHaskell2010

PlutusCore.Evaluation.Machine.Ck

Description

The CK machine.

Synopsis

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

Instances details
MonadFail EvaluationResult Source # 
Instance details

Defined in PlutusCore.Evaluation.Result

Foldable EvaluationResult Source # 
Instance details

Defined in PlutusCore.Evaluation.Result

Methods

foldMonoid m ⇒ EvaluationResult m → m Source #

foldMapMonoid m ⇒ (a → m) → EvaluationResult a → m Source #

foldMap'Monoid m ⇒ (a → m) → EvaluationResult a → m Source #

foldr ∷ (a → b → b) → b → EvaluationResult a → b Source #

foldr' ∷ (a → b → b) → b → EvaluationResult a → b Source #

foldl ∷ (b → a → b) → b → EvaluationResult a → b Source #

foldl' ∷ (b → a → b) → b → EvaluationResult a → b Source #

foldr1 ∷ (a → a → a) → EvaluationResult a → a Source #

foldl1 ∷ (a → a → a) → EvaluationResult a → a Source #

toListEvaluationResult a → [a] Source #

nullEvaluationResult a → Bool Source #

lengthEvaluationResult a → Int Source #

elemEq a ⇒ a → EvaluationResult a → Bool Source #

maximumOrd a ⇒ EvaluationResult a → a Source #

minimumOrd a ⇒ EvaluationResult a → a Source #

sumNum a ⇒ EvaluationResult a → a Source #

productNum a ⇒ EvaluationResult a → a Source #

Traversable EvaluationResult Source # 
Instance details

Defined in PlutusCore.Evaluation.Result

Methods

traverseApplicative f ⇒ (a → f b) → EvaluationResult a → f (EvaluationResult b) Source #

sequenceAApplicative f ⇒ EvaluationResult (f a) → f (EvaluationResult a) Source #

mapMMonad m ⇒ (a → m b) → EvaluationResult a → m (EvaluationResult b) Source #

sequenceMonad m ⇒ EvaluationResult (m a) → m (EvaluationResult a) Source #

Alternative EvaluationResult Source # 
Instance details

Defined in PlutusCore.Evaluation.Result

Applicative EvaluationResult Source # 
Instance details

Defined in PlutusCore.Evaluation.Result

Functor EvaluationResult Source # 
Instance details

Defined in PlutusCore.Evaluation.Result

Methods

fmap ∷ (a → b) → EvaluationResult a → EvaluationResult b Source #

(<$) ∷ a → EvaluationResult b → EvaluationResult a Source #

Monad EvaluationResult Source # 
Instance details

Defined in PlutusCore.Evaluation.Result

MonadError () EvaluationResult Source # 
Instance details

Defined in PlutusCore.Evaluation.Result

KnownTypeAst tyname uni a ⇒ KnownTypeAst tyname uni (EvaluationResult a ∷ Type) Source # 
Instance details

Defined in PlutusCore.Builtin.KnownTypeAst

Associated Types

type IsBuiltin uni (EvaluationResult a) ∷ Bool Source #

type ToHoles uni (EvaluationResult a) ∷ [Hole] Source #

type ToBinds uni acc (EvaluationResult a) ∷ [Some TyNameRep] Source #

Methods

typeAstType0 tyname uni () Source #

(TypeError ('Text "Use \8216BuiltinResult\8217 instead of \8216EvaluationResult\8217") ∷ Constraint, uni ~ UniOf val) ⇒ MakeKnownIn uni val (EvaluationResult a) Source # 
Instance details

Defined in PlutusCore.Builtin.KnownType

(TypeError ('Text "Use \8216BuiltinResult\8217 instead of \8216EvaluationResult\8217") ∷ Constraint, uni ~ UniOf val) ⇒ ReadKnownIn uni val (EvaluationResult a) Source # 
Instance details

Defined in PlutusCore.Builtin.KnownType

PrettyBy config a ⇒ PrettyBy config (EvaluationResult a) Source # 
Instance details

Defined in PlutusCore.Evaluation.Result

Methods

prettyBy ∷ config → EvaluationResult a → Doc ann Source #

prettyListBy ∷ config → [EvaluationResult a] → Doc ann Source #

Generic (EvaluationResult a) Source # 
Instance details

Defined in PlutusCore.Evaluation.Result

Associated Types

type Rep (EvaluationResult a) ∷ TypeType Source #

Show a ⇒ Show (EvaluationResult a) Source # 
Instance details

Defined in PlutusCore.Evaluation.Result

NFData a ⇒ NFData (EvaluationResult a) Source # 
Instance details

Defined in PlutusCore.Evaluation.Result

Methods

rnfEvaluationResult a → () Source #

Eq a ⇒ Eq (EvaluationResult a) Source # 
Instance details

Defined in PlutusCore.Evaluation.Result

AsEvaluationFailure (EvaluationResult a) Source # 
Instance details

Defined in PlutusCore.Evaluation.Result

Methods

_EvaluationFailure ∷ Prism' (EvaluationResult a) () Source #

PrettyClassic a ⇒ Pretty (EvaluationResult a) Source # 
Instance details

Defined in PlutusCore.Evaluation.Result

type ToBinds uni acc (EvaluationResult a ∷ Type) Source # 
Instance details

Defined in PlutusCore.Builtin.KnownTypeAst

type ToBinds uni acc (EvaluationResult a ∷ Type) = ToBinds uni acc a
type IsBuiltin uni (EvaluationResult a ∷ Type) Source # 
Instance details

Defined in PlutusCore.Builtin.KnownTypeAst

type IsBuiltin uni (EvaluationResult a ∷ Type) = 'False
type ToHoles uni (EvaluationResult a ∷ Type) Source # 
Instance details

Defined in PlutusCore.Builtin.KnownTypeAst

type ToHoles uni (EvaluationResult a ∷ Type) = '[TypeHole a ∷ Hole]
type Rep (EvaluationResult a) Source # 
Instance details

Defined in PlutusCore.Evaluation.Result

type Rep (EvaluationResult a) = D1 ('MetaData "EvaluationResult" "PlutusCore.Evaluation.Result" "plutus-core-1.36.0.0-inplace" 'False) (C1 ('MetaCons "EvaluationSuccess" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 a)) :+: C1 ('MetaCons "EvaluationFailure" 'PrefixI 'False) (U1TypeType))

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 #

data CkValue uni fun Source #

Instances

Instances details
(PrettyUni uni, Pretty fun) ⇒ PrettyBy PrettyConfigPlc (CkValue uni fun) Source # 
Instance details

Defined in PlutusCore.Evaluation.Machine.Ck

Methods

prettyByPrettyConfigPlcCkValue uni fun → Doc ann Source #

prettyListByPrettyConfigPlc → [CkValue uni fun] → Doc ann Source #

Show (BuiltinRuntime (CkValue uni fun)) Source # 
Instance details

Defined in PlutusCore.Evaluation.Machine.Ck

Methods

showsPrecIntBuiltinRuntime (CkValue uni fun) → ShowS Source #

showBuiltinRuntime (CkValue uni fun) → String Source #

showList ∷ [BuiltinRuntime (CkValue uni fun)] → ShowS Source #

(GShow uni, Everywhere uni Show, Show fun, Closed uni) ⇒ Show (CkValue uni fun) Source # 
Instance details

Defined in PlutusCore.Evaluation.Machine.Ck

Methods

showsPrecIntCkValue uni fun → ShowS Source #

showCkValue uni fun → String Source #

showList ∷ [CkValue uni fun] → ShowS Source #

HasConstant (CkValue uni fun) Source # 
Instance details

Defined in PlutusCore.Evaluation.Machine.Ck

Methods

asConstantCkValue uni fun → Either BuiltinError (Some (ValueOf (UniOf (CkValue uni fun)))) Source #

fromConstantSome (ValueOf (UniOf (CkValue uni fun))) → CkValue uni fun Source #

ExMemoryUsage (CkValue uni fun) Source # 
Instance details

Defined in PlutusCore.Evaluation.Machine.Ck

Methods

memoryUsageCkValue uni fun → CostRose Source #

type UniOf (CkValue uni fun) Source # 
Instance details

Defined in PlutusCore.Evaluation.Machine.Ck

type UniOf (CkValue uni fun) = uni

runCkBuiltinsRuntime fun (CkValue uni fun) → BoolTerm TyName Name uni fun () → (Either (CkEvaluationException uni fun) (Term TyName Name uni fun ()), [Text]) Source #

splitStructuralOperationalEither (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).

evaluateCkBuiltinsRuntime 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.

evaluateCkNoEmitBuiltinsRuntime 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.

readKnownCkReadKnown (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.