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

PlutusCore.Evaluation.Result

Description

This module defines a common type various evaluation machine use to return their results.

Synopsis

Documentation

class AsEvaluationFailure err where Source #

A class for viewing errors as evaluation failures (in the sense of Plutus).

Methods

_EvaluationFailure :: Prism' err () Source #

Instances

Instances details
AsEvaluationFailure BuiltinError Source # 
Instance details

Defined in PlutusCore.Builtin.Result

AsEvaluationFailure CekUserError Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

AsEvaluationFailure () Source # 
Instance details

Defined in PlutusCore.Evaluation.Result

Methods

_EvaluationFailure :: Prism' () () Source #

AsEvaluationFailure (BuiltinResult a) Source # 
Instance details

Defined in PlutusCore.Builtin.Result

Methods

_EvaluationFailure :: Prism' (BuiltinResult a) () Source #

AsEvaluationFailure (EvaluationResult a) Source # 
Instance details

Defined in PlutusCore.Evaluation.Result

AsEvaluationFailure operational => AsEvaluationFailure (EvaluationError structural operational) Source #

A raw evaluation failure is always an operational error.

Instance details

Defined in PlutusCore.Evaluation.Error

Methods

_EvaluationFailure :: Prism' (EvaluationError structural operational) () Source #

AsEvaluationFailure err => AsEvaluationFailure (ErrorWithCause err cause) Source # 
Instance details

Defined in PlutusCore.Evaluation.ErrorWithCause

Methods

_EvaluationFailure :: Prism' (ErrorWithCause err cause) () Source #

_EvaluationFailureVia :: Eq err => err -> Prism' err () Source #

Construct a prism focusing on the *EvaluationFailure part of err by taking that *EvaluationFailure and

  1. returning it for the setter part of the prism
  2. checking the error for equality with *EvaluationFailure for the opposite direction.

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

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

Applicative EvaluationResult Source # 
Instance details

Defined in PlutusCore.Evaluation.Result

Functor EvaluationResult Source # 
Instance details

Defined in PlutusCore.Evaluation.Result

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

typeAst :: Type0 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 #

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

Generic (EvaluationResult a) Source # 
Instance details

Defined in PlutusCore.Evaluation.Result

Associated Types

type Rep (EvaluationResult a) :: Type -> Type 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

rnf :: EvaluationResult 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

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

Defined in PlutusCore.Evaluation.Result

Methods

pretty :: EvaluationResult a -> Doc ann #

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

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 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-7ehJj5tIPqoJIiiivXkX9N" 'False) (C1 ('MetaCons "EvaluationSuccess" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 a)) :+: C1 ('MetaCons "EvaluationFailure" 'PrefixI 'False) (U1 :: Type -> Type))