plutus-core-1.0.0.1: Language library for Plutus Core
Safe HaskellNone
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
Monad EvaluationResult Source # 
Instance details

Defined in PlutusCore.Evaluation.Result

Functor EvaluationResult Source # 
Instance details

Defined in PlutusCore.Evaluation.Result

MonadFail EvaluationResult Source # 
Instance details

Defined in PlutusCore.Evaluation.Result

Applicative EvaluationResult Source # 
Instance details

Defined in PlutusCore.Evaluation.Result

Foldable EvaluationResult Source # 
Instance details

Defined in PlutusCore.Evaluation.Result

Methods

fold :: Monoid m => EvaluationResult m -> m Source #

foldMap :: Monoid 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 #

toList :: EvaluationResult a -> [a] Source #

null :: EvaluationResult a -> Bool Source #

length :: EvaluationResult a -> Int Source #

elem :: Eq a => a -> EvaluationResult a -> Bool Source #

maximum :: Ord a => EvaluationResult a -> a Source #

minimum :: Ord a => EvaluationResult a -> a Source #

sum :: Num a => EvaluationResult a -> a Source #

product :: Num a => EvaluationResult a -> a Source #

Traversable EvaluationResult Source # 
Instance details

Defined in PlutusCore.Evaluation.Result

Alternative EvaluationResult Source # 
Instance details

Defined in PlutusCore.Evaluation.Result

MonadError () EvaluationResult Source # 
Instance details

Defined in PlutusCore.Evaluation.Result

(TypeError ('Text "\8216EvaluationResult\8217 cannot appear in the type of an argument") :: Constraint, uni ~ UniOf val) => ReadKnownIn uni val (EvaluationResult a) Source # 
Instance details

Defined in PlutusCore.Builtin.KnownType

Methods

readKnown :: Maybe cause -> val -> ReadKnownM cause (EvaluationResult a) Source #

MakeKnownIn uni val a => MakeKnownIn uni val (EvaluationResult a) Source # 
Instance details

Defined in PlutusCore.Builtin.KnownType

Methods

makeKnown :: Maybe cause -> EvaluationResult a -> MakeKnownM cause val Source #

PrettyBy config a => PrettyBy config (EvaluationResult a) Source # 
Instance details

Defined in PlutusCore.Evaluation.Result

Methods

prettyBy :: config -> EvaluationResult a -> Doc ann #

prettyListBy :: config -> [EvaluationResult a] -> Doc ann #

Eq a => Eq (EvaluationResult a) Source # 
Instance details

Defined in PlutusCore.Evaluation.Result

Show a => Show (EvaluationResult a) Source # 
Instance details

Defined in PlutusCore.Evaluation.Result

Generic (EvaluationResult a) Source # 
Instance details

Defined in PlutusCore.Evaluation.Result

Associated Types

type Rep (EvaluationResult a) :: Type -> Type Source #

NFData a => NFData (EvaluationResult a) Source # 
Instance details

Defined in PlutusCore.Evaluation.Result

Methods

rnf :: EvaluationResult a -> () Source #

PrettyClassic a => Pretty (EvaluationResult a) Source # 
Instance details

Defined in PlutusCore.Evaluation.Result

Methods

pretty :: EvaluationResult a -> Doc ann #

prettyList :: [EvaluationResult a] -> Doc ann #

KnownTypeAst uni a => KnownTypeAst uni (EvaluationResult a :: Type) Source # 
Instance details

Defined in PlutusCore.Builtin.KnownTypeAst

Associated Types

type ToHoles (EvaluationResult a) :: [Hole] Source #

type ToBinds (EvaluationResult a) :: [Some TyNameRep] Source #

Methods

toTypeAst :: proxy (EvaluationResult a) -> Type0 TyName uni () Source #

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.0.0.1-6wMiyL0yerXJu56t8zBoKx" 'False) (C1 ('MetaCons "EvaluationSuccess" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)) :+: C1 ('MetaCons "EvaluationFailure" 'PrefixI 'False) (U1 :: Type -> Type))
type ToHoles (EvaluationResult a :: Type) Source # 
Instance details

Defined in PlutusCore.Builtin.KnownTypeAst

type ToHoles (EvaluationResult a :: Type) = '[TypeHole a :: Hole]
type ToBinds (EvaluationResult a :: Type) Source # 
Instance details

Defined in PlutusCore.Builtin.KnownTypeAst

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 #

data CkValue uni fun Source #

Instances

Instances details
(Closed uni, GShow uni, Everywhere uni PrettyConst, Pretty fun) => PrettyBy PrettyConfigPlc (CkValue uni fun) Source # 
Instance details

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 # 
Instance details

Defined in PlutusCore.Evaluation.Machine.Ck

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

Defined in PlutusCore.Evaluation.Machine.Ck

Methods

showsPrec :: Int -> CkValue uni fun -> ShowS Source #

show :: CkValue uni fun -> String Source #

showList :: [CkValue uni fun] -> ShowS Source #

HasConstant (CkValue uni fun) Source # 
Instance details

Defined in PlutusCore.Evaluation.Machine.Ck

Methods

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 # 
Instance details

Defined in PlutusCore.Evaluation.Machine.Ck

type UniOf (CkValue uni fun) = uni

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.