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

UntypedPlutusCore.Evaluation.Machine.Cek

Description

The API to the CEK machine.

Synopsis

Running the machine

runCekThrowableBuiltins uni fun ⇒ MachineParameters CekMachineCosts fun (CekValue uni fun ann) → ExBudgetMode cost uni fun → EmitterMode uni fun → Term Name uni fun ann → (Either (CekEvaluationException Name uni fun) (Term Name uni fun ()), cost, [Text]) Source #

Evaluate a term using the CEK machine with logging enabled and keep track of costing. A wrapper around the internal runCek to debruijn input and undebruijn output. *THIS FUNCTION IS PARTIAL if the input term contains free variables*

runCekDeBruijnThrowableBuiltins uni fun ⇒ MachineParameters CekMachineCosts fun (CekValue uni fun ann) → ExBudgetMode cost uni fun → EmitterMode uni fun → NTerm uni fun ann → (Either (CekEvaluationException NamedDeBruijn uni fun) (NTerm uni fun ()), cost, [Text]) Source #

Evaluate a term using the CEK machine and keep track of costing, logging is optional.

runCekNoEmitThrowableBuiltins uni fun ⇒ MachineParameters CekMachineCosts fun (CekValue uni fun ann) → ExBudgetMode cost uni fun → Term Name uni fun ann → (Either (CekEvaluationException Name uni fun) (Term Name uni fun ()), cost) Source #

Evaluate a term using the CEK machine with logging disabled and keep track of costing. *THIS FUNCTION IS PARTIAL if the input term contains free variables*

evaluateCekThrowableBuiltins uni fun ⇒ EmitterMode uni fun → MachineParameters CekMachineCosts fun (CekValue uni fun ann) → Term Name uni fun ann → (Either (CekEvaluationException Name uni fun) (Term Name uni fun ()), [Text]) Source #

Evaluate a term using the CEK machine with logging enabled. *THIS FUNCTION IS PARTIAL if the input term contains free variables*

evaluateCekNoEmitThrowableBuiltins uni fun ⇒ MachineParameters CekMachineCosts fun (CekValue uni fun ann) → Term Name uni fun ann → Either (CekEvaluationException Name uni fun) (Term Name uni fun ()) Source #

Evaluate a term using the CEK machine with logging disabled. *THIS FUNCTION IS PARTIAL if the input term contains free variables*

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))

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

Errors

data CekUserError Source #

Constructors

CekOutOfExError !ExRestrictingBudget

The final overspent (i.e. negative) budget.

CekEvaluationFailure

Error has been called or a builtin application has failed

Instances

Instances details
Generic CekUserError Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

Associated Types

type Rep CekUserErrorTypeType Source #

Show CekUserError Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

NFData CekUserError Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

Methods

rnfCekUserError → () Source #

Eq CekUserError Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

AsUnliftingError CekUserError Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

AsEvaluationFailure CekUserError Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

Pretty CekUserError Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

Methods

prettyCekUserErrorDoc ann Source #

prettyList ∷ [CekUserError] → Doc ann Source #

ThrowableBuiltins uni fun ⇒ MonadError (CekEvaluationException NamedDeBruijn uni fun) (CekM uni fun s) Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

Methods

throwErrorCekEvaluationException NamedDeBruijn uni fun → CekM uni fun s a Source #

catchErrorCekM uni fun s a → (CekEvaluationException NamedDeBruijn uni fun → CekM uni fun s a) → CekM uni fun s a Source #

type Rep CekUserError Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

type Rep CekUserError = D1 ('MetaData "CekUserError" "UntypedPlutusCore.Evaluation.Machine.Cek.Internal" "plutus-core-1.36.0.0-inplace" 'False) (C1 ('MetaCons "CekOutOfExError" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ExRestrictingBudget)) :+: C1 ('MetaCons "CekEvaluationFailure" 'PrefixI 'False) (U1TypeType))

data ErrorWithCause err cause Source #

An error and (optionally) what caused it.

Constructors

ErrorWithCause 

Fields

Instances

Instances details
Bifunctor ErrorWithCause Source # 
Instance details

Defined in PlutusCore.Evaluation.ErrorWithCause

Methods

bimap ∷ (a → b) → (c → d) → ErrorWithCause a c → ErrorWithCause b d Source #

first ∷ (a → b) → ErrorWithCause a c → ErrorWithCause b c Source #

second ∷ (b → c) → ErrorWithCause a b → ErrorWithCause a c Source #

(PrettyBy config cause, PrettyBy config err) ⇒ PrettyBy config (ErrorWithCause err cause) Source # 
Instance details

Defined in PlutusCore.Evaluation.ErrorWithCause

Methods

prettyBy ∷ config → ErrorWithCause err cause → Doc ann Source #

prettyListBy ∷ config → [ErrorWithCause err cause] → Doc ann Source #

Foldable (ErrorWithCause err) Source # 
Instance details

Defined in PlutusCore.Evaluation.ErrorWithCause

Methods

foldMonoid m ⇒ ErrorWithCause err m → m Source #

foldMapMonoid m ⇒ (a → m) → ErrorWithCause err a → m Source #

foldMap'Monoid m ⇒ (a → m) → ErrorWithCause err a → m Source #

foldr ∷ (a → b → b) → b → ErrorWithCause err a → b Source #

foldr' ∷ (a → b → b) → b → ErrorWithCause err a → b Source #

foldl ∷ (b → a → b) → b → ErrorWithCause err a → b Source #

foldl' ∷ (b → a → b) → b → ErrorWithCause err a → b Source #

foldr1 ∷ (a → a → a) → ErrorWithCause err a → a Source #

foldl1 ∷ (a → a → a) → ErrorWithCause err a → a Source #

toListErrorWithCause err a → [a] Source #

nullErrorWithCause err a → Bool Source #

lengthErrorWithCause err a → Int Source #

elemEq a ⇒ a → ErrorWithCause err a → Bool Source #

maximumOrd a ⇒ ErrorWithCause err a → a Source #

minimumOrd a ⇒ ErrorWithCause err a → a Source #

sumNum a ⇒ ErrorWithCause err a → a Source #

productNum a ⇒ ErrorWithCause err a → a Source #

Traversable (ErrorWithCause err) Source # 
Instance details

Defined in PlutusCore.Evaluation.ErrorWithCause

Methods

traverseApplicative f ⇒ (a → f b) → ErrorWithCause err a → f (ErrorWithCause err b) Source #

sequenceAApplicative f ⇒ ErrorWithCause err (f a) → f (ErrorWithCause err a) Source #

mapMMonad m ⇒ (a → m b) → ErrorWithCause err a → m (ErrorWithCause err b) Source #

sequenceMonad m ⇒ ErrorWithCause err (m a) → m (ErrorWithCause err a) Source #

Functor (ErrorWithCause err) Source # 
Instance details

Defined in PlutusCore.Evaluation.ErrorWithCause

Methods

fmap ∷ (a → b) → ErrorWithCause err a → ErrorWithCause err b Source #

(<$) ∷ a → ErrorWithCause err b → ErrorWithCause err a Source #

(PrettyPlc cause, PrettyPlc err, Typeable cause, Typeable err) ⇒ Exception (ErrorWithCause err cause) Source # 
Instance details

Defined in PlutusCore.Evaluation.ErrorWithCause

Generic (ErrorWithCause err cause) Source # 
Instance details

Defined in PlutusCore.Evaluation.ErrorWithCause

Associated Types

type Rep (ErrorWithCause err cause) ∷ TypeType Source #

Methods

fromErrorWithCause err cause → Rep (ErrorWithCause err cause) x Source #

toRep (ErrorWithCause err cause) x → ErrorWithCause err cause Source #

(PrettyPlc cause, PrettyPlc err) ⇒ Show (ErrorWithCause err cause) Source # 
Instance details

Defined in PlutusCore.Evaluation.ErrorWithCause

Methods

showsPrecIntErrorWithCause err cause → ShowS Source #

showErrorWithCause err cause → String Source #

showList ∷ [ErrorWithCause err cause] → ShowS Source #

(NFData err, NFData cause) ⇒ NFData (ErrorWithCause err cause) Source # 
Instance details

Defined in PlutusCore.Evaluation.ErrorWithCause

Methods

rnfErrorWithCause err cause → () Source #

(Eq err, Eq cause) ⇒ Eq (ErrorWithCause err cause) Source # 
Instance details

Defined in PlutusCore.Evaluation.ErrorWithCause

Methods

(==)ErrorWithCause err cause → ErrorWithCause err cause → Bool Source #

(/=)ErrorWithCause err cause → ErrorWithCause err cause → Bool Source #

AsEvaluationFailure err ⇒ AsEvaluationFailure (ErrorWithCause err cause) Source # 
Instance details

Defined in PlutusCore.Evaluation.ErrorWithCause

Methods

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

(Pretty err, Pretty cause) ⇒ Pretty (ErrorWithCause err cause) Source # 
Instance details

Defined in PlutusCore.Evaluation.ErrorWithCause

Methods

prettyErrorWithCause err cause → Doc ann Source #

prettyList ∷ [ErrorWithCause err cause] → Doc ann Source #

ThrowableBuiltins uni fun ⇒ MonadError (CekEvaluationException NamedDeBruijn uni fun) (CekM uni fun s) Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

Methods

throwErrorCekEvaluationException NamedDeBruijn uni fun → CekM uni fun s a Source #

catchErrorCekM uni fun s a → (CekEvaluationException NamedDeBruijn uni fun → CekM uni fun s a) → CekM uni fun s a Source #

type Rep (ErrorWithCause err cause) Source # 
Instance details

Defined in PlutusCore.Evaluation.ErrorWithCause

type Rep (ErrorWithCause err cause) = D1 ('MetaData "ErrorWithCause" "PlutusCore.Evaluation.ErrorWithCause" "plutus-core-1.36.0.0-inplace" 'False) (C1 ('MetaCons "ErrorWithCause" 'PrefixI 'True) (S1 ('MetaSel ('Just "_ewcError") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 err) :*: S1 ('MetaSel ('Just "_ewcCause") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe cause))))

type CekEvaluationException name uni fun = EvaluationException (MachineError fun) CekUserError (Term name uni fun ()) Source #

The CEK machine-specific EvaluationException.

data EvaluationError structural operational Source #

The type of errors that can occur during evaluation. There are two kinds of errors:

  1. Structural ones -- these are errors that are indicative of the _structure_ of the program being wrong. For example, a free variable was encountered during evaluation, a non-function was applied to an argument or tailList was applied to a non-list.
  2. Operational ones -- these are errors that are indicative of the _logic_ of the program being wrong. For example, error was executed, tailList was applied to an empty list or evaluation ran out of gas.

On the chain both of these are just regular failures and we don't distinguish between them there: if a script fails, it fails, it doesn't matter what the reason was. However in the tests it does matter why the failure occurred: a structural error may indicate that the test was written incorrectly while an operational error may be entirely expected.

In other words, structural errors are "runtime type errors" and operational errors are regular runtime errors. Which means that evaluating an (erased) well-typed program should never produce a structural error, only an operational one. This creates a sort of "runtime type system" for UPLC and it would be great to stick to it and enforce in tests etc, but we currently don't.

Constructors

StructuralEvaluationError !structural 
OperationalEvaluationError !operational 

Instances

Instances details
Bifoldable EvaluationError Source # 
Instance details

Defined in PlutusCore.Evaluation.Error

Methods

bifoldMonoid m ⇒ EvaluationError m m → m Source #

bifoldMapMonoid m ⇒ (a → m) → (b → m) → EvaluationError a b → m Source #

bifoldr ∷ (a → c → c) → (b → c → c) → c → EvaluationError a b → c Source #

bifoldl ∷ (c → a → c) → (c → b → c) → c → EvaluationError a b → c Source #

Bifunctor EvaluationError Source # 
Instance details

Defined in PlutusCore.Evaluation.Error

Methods

bimap ∷ (a → b) → (c → d) → EvaluationError a c → EvaluationError b d Source #

first ∷ (a → b) → EvaluationError a c → EvaluationError b c Source #

second ∷ (b → c) → EvaluationError a b → EvaluationError a c Source #

Bitraversable EvaluationError Source # 
Instance details

Defined in PlutusCore.Evaluation.Error

Methods

bitraverseApplicative f ⇒ (a → f c) → (b → f d) → EvaluationError a b → f (EvaluationError c d) Source #

(HasPrettyDefaults config ~ 'True, PrettyBy config structural, Pretty operational) ⇒ PrettyBy config (EvaluationError structural operational) Source # 
Instance details

Defined in PlutusCore.Evaluation.Error

Methods

prettyBy ∷ config → EvaluationError structural operational → Doc ann Source #

prettyListBy ∷ config → [EvaluationError structural operational] → Doc ann Source #

Functor (EvaluationError structural) Source # 
Instance details

Defined in PlutusCore.Evaluation.Error

Methods

fmap ∷ (a → b) → EvaluationError structural a → EvaluationError structural b Source #

(<$) ∷ a → EvaluationError structural b → EvaluationError structural a Source #

Generic (EvaluationError structural operational) Source # 
Instance details

Defined in PlutusCore.Evaluation.Error

Associated Types

type Rep (EvaluationError structural operational) ∷ TypeType Source #

Methods

fromEvaluationError structural operational → Rep (EvaluationError structural operational) x Source #

toRep (EvaluationError structural operational) x → EvaluationError structural operational Source #

(Show structural, Show operational) ⇒ Show (EvaluationError structural operational) Source # 
Instance details

Defined in PlutusCore.Evaluation.Error

Methods

showsPrecIntEvaluationError structural operational → ShowS Source #

showEvaluationError structural operational → String Source #

showList ∷ [EvaluationError structural operational] → ShowS Source #

(NFData structural, NFData operational) ⇒ NFData (EvaluationError structural operational) Source # 
Instance details

Defined in PlutusCore.Evaluation.Error

Methods

rnfEvaluationError structural operational → () Source #

(Eq structural, Eq operational) ⇒ Eq (EvaluationError structural operational) Source # 
Instance details

Defined in PlutusCore.Evaluation.Error

Methods

(==)EvaluationError structural operational → EvaluationError structural operational → Bool Source #

(/=)EvaluationError structural operational → EvaluationError structural operational → Bool Source #

(AsUnliftingError structural, AsUnliftingError operational) ⇒ AsUnliftingEvaluationError (EvaluationError structural operational) Source #

An UnliftingEvaluationError is an EvaluationError, hence for this instance we only require both structural and operational to have _UnliftingError prisms, so that we can handle both the cases pointwisely.

Instance details

Defined in PlutusCore.Builtin.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 #

(Pretty structural, Pretty operational) ⇒ Pretty (EvaluationError structural operational) Source # 
Instance details

Defined in PlutusCore.Evaluation.Error

Methods

prettyEvaluationError structural operational → Doc ann Source #

prettyList ∷ [EvaluationError structural operational] → Doc ann Source #

structural ~ MachineError fun ⇒ AsMachineError (EvaluationError structural operational) fun Source # 
Instance details

Defined in PlutusCore.Evaluation.Machine.Exception

Methods

_MachineError ∷ Prism' (EvaluationError structural operational) (MachineError fun) Source #

_NonPolymorphicInstantiationMachineError ∷ Prism' (EvaluationError structural operational) () Source #

_NonWrapUnwrappedMachineError ∷ Prism' (EvaluationError structural operational) () Source #

_NonFunctionalApplicationMachineError ∷ Prism' (EvaluationError structural operational) () Source #

_OpenTermEvaluatedMachineError ∷ Prism' (EvaluationError structural operational) () Source #

_UnliftingMachineError ∷ Prism' (EvaluationError structural operational) UnliftingError Source #

_BuiltinTermArgumentExpectedMachineError ∷ Prism' (EvaluationError structural operational) () Source #

_UnexpectedBuiltinTermArgumentMachineError ∷ Prism' (EvaluationError structural operational) () Source #

_NonConstrScrutinized ∷ Prism' (EvaluationError structural operational) () Source #

_MissingCaseBranch ∷ Prism' (EvaluationError structural operational) Word64 Source #

AsEvaluationError (EvaluationError structural operational) structural operational Source # 
Instance details

Defined in PlutusCore.Evaluation.Error

Methods

_EvaluationError ∷ Prism' (EvaluationError structural operational) (EvaluationError structural operational) Source #

_StructuralEvaluationError ∷ Prism' (EvaluationError structural operational) structural Source #

_OperationalEvaluationError ∷ Prism' (EvaluationError structural operational) operational Source #

ThrowableBuiltins uni fun ⇒ MonadError (CekEvaluationException NamedDeBruijn uni fun) (CekM uni fun s) Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

Methods

throwErrorCekEvaluationException NamedDeBruijn uni fun → CekM uni fun s a Source #

catchErrorCekM uni fun s a → (CekEvaluationException NamedDeBruijn uni fun → CekM uni fun s a) → CekM uni fun s a Source #

type Rep (EvaluationError structural operational) Source # 
Instance details

Defined in PlutusCore.Evaluation.Error

type Rep (EvaluationError structural operational) = D1 ('MetaData "EvaluationError" "PlutusCore.Evaluation.Error" "plutus-core-1.36.0.0-inplace" 'False) (C1 ('MetaCons "StructuralEvaluationError" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 structural)) :+: C1 ('MetaCons "OperationalEvaluationError" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 operational)))

Costing

data ExBudgetCategory fun Source #

Constructors

BStep StepKind 
BBuiltinApp fun 
BStartup 

Instances

Instances details
ExBudgetBuiltin fun (ExBudgetCategory fun) Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

Methods

exBudgetBuiltin ∷ fun → ExBudgetCategory fun Source #

Generic (ExBudgetCategory fun) Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

Associated Types

type Rep (ExBudgetCategory fun) ∷ TypeType Source #

Show fun ⇒ Show (ExBudgetCategory fun) Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

NFData fun ⇒ NFData (ExBudgetCategory fun) Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

Methods

rnfExBudgetCategory fun → () Source #

Eq fun ⇒ Eq (ExBudgetCategory fun) Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

Ord fun ⇒ Ord (ExBudgetCategory fun) Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

Hashable fun ⇒ Hashable (ExBudgetCategory fun) Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

Show fun ⇒ Pretty (ExBudgetCategory fun) Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

Methods

prettyExBudgetCategory fun → Doc ann Source #

prettyList ∷ [ExBudgetCategory fun] → Doc ann Source #

type Rep (ExBudgetCategory fun) Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

type Rep (ExBudgetCategory fun) = D1 ('MetaData "ExBudgetCategory" "UntypedPlutusCore.Evaluation.Machine.Cek.Internal" "plutus-core-1.36.0.0-inplace" 'False) (C1 ('MetaCons "BStep" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 StepKind)) :+: (C1 ('MetaCons "BBuiltinApp" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 fun)) :+: C1 ('MetaCons "BStartup" 'PrefixI 'False) (U1TypeType)))

newtype CekBudgetSpender uni fun s Source #

The CEK machine is parameterized over a spendBudget function. This makes the budgeting machinery extensible and allows us to separate budgeting logic from evaluation logic and avoid branching on the union of all possible budgeting state types during evaluation.

Constructors

CekBudgetSpender 

Fields

newtype ExBudgetMode cost uni fun Source #

A budgeting mode to execute the CEK machine in.

Constructors

ExBudgetMode 

Fields

data StepKind Source #

Instances

Instances details
Bounded StepKind Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

Enum StepKind Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

Generic StepKind Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

Associated Types

type Rep StepKindTypeType Source #

Show StepKind Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

NFData StepKind Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

Methods

rnfStepKind → () Source #

Eq StepKind Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

Ord StepKind Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

Hashable StepKind Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

type Rep StepKind Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

type Rep StepKind = D1 ('MetaData "StepKind" "UntypedPlutusCore.Evaluation.Machine.Cek.Internal" "plutus-core-1.36.0.0-inplace" 'False) (((C1 ('MetaCons "BConst" 'PrefixI 'False) (U1TypeType) :+: C1 ('MetaCons "BVar" 'PrefixI 'False) (U1TypeType)) :+: (C1 ('MetaCons "BLamAbs" 'PrefixI 'False) (U1TypeType) :+: C1 ('MetaCons "BApply" 'PrefixI 'False) (U1TypeType))) :+: ((C1 ('MetaCons "BDelay" 'PrefixI 'False) (U1TypeType) :+: C1 ('MetaCons "BForce" 'PrefixI 'False) (U1TypeType)) :+: (C1 ('MetaCons "BBuiltin" 'PrefixI 'False) (U1TypeType) :+: (C1 ('MetaCons "BConstr" 'PrefixI 'False) (U1TypeType) :+: C1 ('MetaCons "BCase" 'PrefixI 'False) (U1TypeType)))))

newtype CekExTally fun Source #

For a detailed report on what costs how much + the same overall budget that Counting gives. The (derived) Monoid instance of CekExTally is the main piece of the machinery.

Instances

Instances details
(Show fun, Ord fun) ⇒ PrettyBy config (CekExTally fun) Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.ExBudgetMode

Methods

prettyBy ∷ config → CekExTally fun → Doc ann Source #

prettyListBy ∷ config → [CekExTally fun] → Doc ann Source #

Hashable fun ⇒ Monoid (CekExTally fun) Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.ExBudgetMode

Methods

memptyCekExTally fun Source #

mappendCekExTally fun → CekExTally fun → CekExTally fun Source #

mconcat ∷ [CekExTally fun] → CekExTally fun Source #

Hashable fun ⇒ Semigroup (CekExTally fun) Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.ExBudgetMode

Methods

(<>)CekExTally fun → CekExTally fun → CekExTally fun Source #

sconcatNonEmpty (CekExTally fun) → CekExTally fun Source #

stimesIntegral b ⇒ b → CekExTally fun → CekExTally fun Source #

Generic (CekExTally fun) Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.ExBudgetMode

Associated Types

type Rep (CekExTally fun) ∷ TypeType Source #

Methods

fromCekExTally fun → Rep (CekExTally fun) x Source #

toRep (CekExTally fun) x → CekExTally fun Source #

Show fun ⇒ Show (CekExTally fun) Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.ExBudgetMode

Methods

showsPrecIntCekExTally fun → ShowS Source #

showCekExTally fun → String Source #

showList ∷ [CekExTally fun] → ShowS Source #

NFData fun ⇒ NFData (CekExTally fun) Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.ExBudgetMode

Methods

rnfCekExTally fun → () Source #

Eq fun ⇒ Eq (CekExTally fun) Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.ExBudgetMode

Methods

(==)CekExTally fun → CekExTally fun → Bool Source #

(/=)CekExTally fun → CekExTally fun → Bool Source #

(Show fun, Ord fun) ⇒ Pretty (CekExTally fun) Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.ExBudgetMode

Methods

prettyCekExTally fun → Doc ann Source #

prettyList ∷ [CekExTally fun] → Doc ann Source #

type Rep (CekExTally fun) Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.ExBudgetMode

type Rep (CekExTally fun) = D1 ('MetaData "CekExTally" "UntypedPlutusCore.Evaluation.Machine.Cek.ExBudgetMode" "plutus-core-1.36.0.0-inplace" 'True) (C1 ('MetaCons "CekExTally" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (MonoidalHashMap (ExBudgetCategory fun) ExBudget))))

newtype CountingSt Source #

For calculating the cost of execution by counting up using the Monoid instance of ExBudget.

Constructors

CountingSt ExBudget 

Instances

Instances details
Monoid CountingSt Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.ExBudgetMode

Semigroup CountingSt Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.ExBudgetMode

Show CountingSt Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.ExBudgetMode

NFData CountingSt Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.ExBudgetMode

Methods

rnfCountingSt → () Source #

Eq CountingSt Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.ExBudgetMode

Pretty CountingSt Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.ExBudgetMode

Methods

prettyCountingStDoc ann Source #

prettyList ∷ [CountingSt] → Doc ann Source #

PrettyBy config CountingSt Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.ExBudgetMode

Methods

prettyBy ∷ config → CountingStDoc ann Source #

prettyListBy ∷ config → [CountingSt] → Doc ann Source #

data TallyingSt fun Source #

Constructors

TallyingSt (CekExTally fun) ExBudget 

Instances

Instances details
(Show fun, Ord fun) ⇒ PrettyBy config (TallyingSt fun) Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.ExBudgetMode

Methods

prettyBy ∷ config → TallyingSt fun → Doc ann Source #

prettyListBy ∷ config → [TallyingSt fun] → Doc ann Source #

Hashable fun ⇒ Monoid (TallyingSt fun) Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.ExBudgetMode

Methods

memptyTallyingSt fun Source #

mappendTallyingSt fun → TallyingSt fun → TallyingSt fun Source #

mconcat ∷ [TallyingSt fun] → TallyingSt fun Source #

Hashable fun ⇒ Semigroup (TallyingSt fun) Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.ExBudgetMode

Methods

(<>)TallyingSt fun → TallyingSt fun → TallyingSt fun Source #

sconcatNonEmpty (TallyingSt fun) → TallyingSt fun Source #

stimesIntegral b ⇒ b → TallyingSt fun → TallyingSt fun Source #

Generic (TallyingSt fun) Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.ExBudgetMode

Associated Types

type Rep (TallyingSt fun) ∷ TypeType Source #

Methods

fromTallyingSt fun → Rep (TallyingSt fun) x Source #

toRep (TallyingSt fun) x → TallyingSt fun Source #

Show fun ⇒ Show (TallyingSt fun) Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.ExBudgetMode

Methods

showsPrecIntTallyingSt fun → ShowS Source #

showTallyingSt fun → String Source #

showList ∷ [TallyingSt fun] → ShowS Source #

NFData fun ⇒ NFData (TallyingSt fun) Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.ExBudgetMode

Methods

rnfTallyingSt fun → () Source #

Eq fun ⇒ Eq (TallyingSt fun) Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.ExBudgetMode

Methods

(==)TallyingSt fun → TallyingSt fun → Bool Source #

(/=)TallyingSt fun → TallyingSt fun → Bool Source #

(Show fun, Ord fun) ⇒ Pretty (TallyingSt fun) Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.ExBudgetMode

Methods

prettyTallyingSt fun → Doc ann Source #

prettyList ∷ [TallyingSt fun] → Doc ann Source #

type Rep (TallyingSt fun) Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.ExBudgetMode

type Rep (TallyingSt fun) = D1 ('MetaData "TallyingSt" "UntypedPlutusCore.Evaluation.Machine.Cek.ExBudgetMode" "plutus-core-1.36.0.0-inplace" 'False) (C1 ('MetaCons "TallyingSt" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (CekExTally fun)) :*: S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ExBudget)))

newtype RestrictingSt Source #

Instances

Instances details
Monoid RestrictingSt Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.ExBudgetMode

Semigroup RestrictingSt Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.ExBudgetMode

Show RestrictingSt Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.ExBudgetMode

NFData RestrictingSt Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.ExBudgetMode

Methods

rnfRestrictingSt → () Source #

Eq RestrictingSt Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.ExBudgetMode

Pretty RestrictingSt Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.ExBudgetMode

PrettyBy config RestrictingSt Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.ExBudgetMode

Methods

prettyBy ∷ config → RestrictingStDoc ann Source #

prettyListBy ∷ config → [RestrictingSt] → Doc ann Source #

type CekMachineCosts = CekMachineCostsBase Identity Source #

Costs for evaluating AST nodes. Times should be specified in picoseconds, memory sizes in bytes.

Costing modes

monoidalBudgetingMonoid cost ⇒ (ExBudgetCategory fun → ExBudget → cost) → ExBudgetMode cost uni fun Source #

Construct an ExBudgetMode out of a function returning a value of the budgeting state type. The value then gets added to the current state via (<>).

countingExBudgetMode CountingSt uni fun Source #

For calculating the cost of execution.

tallyingHashable fun ⇒ ExBudgetMode (TallyingSt fun) uni fun Source #

For a detailed report on what costs how much + the same overall budget that Counting gives.

restrictingThrowableBuiltins uni fun ⇒ ExRestrictingBudgetExBudgetMode RestrictingSt uni fun Source #

For execution, to avoid overruns.

enormousBudgetExRestrictingBudget Source #

When we want to just evaluate the program we use the Restricting mode with an enormous budget, so that evaluation costs of on-chain budgeting are reflected accurately in benchmarks.

Emitter modes

noEmitterEmitterMode uni fun Source #

No emitter.

logEmitterEmitterMode uni fun Source #

Emits log only.

logWithTimeEmitterEmitterMode uni fun Source #

Emits log with timestamp.

logWithBudgetEmitterEmitterMode uni fun Source #

Emits log with the budget.

Misc

data BuiltinsRuntime fun val Source #

A data wrapper around a function returning the BuiltinRuntime of a built-in function. We use data rather than newtype, because GHC is able to see through newtypes and may break carefully set up optimizations, see https://github.com/IntersectMBO/plutus/pull/4914#issuecomment-1396306606

Using data may make things more expensive, however it was verified at the time of writing that the wrapper is removed before the CEK machine starts, leaving the stored function to be used directly.

In order for lookups to be efficient the BuiltinRuntimes need to be cached, i.e. pulled out of the function statically. See makeBuiltinMeaning for how we achieve that.

Constructors

BuiltinsRuntime 

Fields

Instances

Instances details
(Bounded fun, Enum fun) ⇒ NFData (BuiltinsRuntime fun val) Source # 
Instance details

Defined in PlutusCore.Builtin.Runtime

Methods

rnfBuiltinsRuntime fun val → () Source #

(Bounded fun, Enum fun) ⇒ NoThunks (BuiltinsRuntime fun val) Source # 
Instance details

Defined in PlutusCore.Builtin.Runtime

data CekValue uni fun ann Source #

Constructors

VCon !(Some (ValueOf uni)) 
VDelay !(NTerm uni fun ann) !(CekValEnv uni fun ann) 
VLamAbs !NamedDeBruijn !(NTerm uni fun ann) !(CekValEnv uni fun ann) 
VBuiltin

A partial builtin application, accumulating arguments for eventual full application. We don't need a CekValEnv here unlike in the other constructors, because VBuiltin values always store their corresponding Terms fully discharged, see the comments at the call sites (search for VBuiltin).

Fields

  • !fun

    So that we know, for what builtin we're calculating the cost. We can sneak this into BuiltinRuntime, so that we don't need to store it here, but somehow doing so was consistently slowing evaluation down by half a percent. Might be noise, might be not, but at least we know that removing this fun is not helpful anyway. See this commit reversing the change: https://github.com/IntersectMBO/plutus/pull/4778/commits/86a3e24ca3c671cc27c6f4344da2bcd14f961706

  • (NTerm uni fun ())

    This must be lazy. It represents the fully discharged partial application of the builtin function that we're going to run when it's fully saturated. We need the Term to be able to return it in case full saturation is never achieved and a partial application needs to be returned in the result. The laziness is important, because the arguments are discharged values and discharging is expensive, so we don't want to do it unless we really have to. Making this field strict resulted in a 3-4.5% slowdown at the time of writing.

  • !(BuiltinRuntime (CekValue uni fun ann))

    The partial application and its costing function. Check the docs of BuiltinRuntime for details. | A constructor value, including fully computed arguments and the tag.

VConstr !Word64 !(ArgStack uni fun ann) 

Instances

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

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

Methods

prettyByPrettyConfigPlcCekValue uni fun ann → Doc ann0 Source #

prettyListByPrettyConfigPlc → [CekValue uni fun ann] → Doc ann0 Source #

Show (BuiltinRuntime (CekValue uni fun ann)) Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

Methods

showsPrecIntBuiltinRuntime (CekValue uni fun ann) → ShowS Source #

showBuiltinRuntime (CekValue uni fun ann) → String Source #

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

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

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

Methods

showsPrecIntCekValue uni fun ann → ShowS Source #

showCekValue uni fun ann → String Source #

showList ∷ [CekValue uni fun ann] → ShowS Source #

HasConstant (CekValue uni fun ann) Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

Methods

asConstantCekValue uni fun ann → Either BuiltinError (Some (ValueOf (UniOf (CekValue uni fun ann)))) Source #

fromConstantSome (ValueOf (UniOf (CekValue uni fun ann))) → CekValue uni fun ann Source #

(Closed uni, Everywhere uni ExMemoryUsage) ⇒ ExMemoryUsage (CekValue uni fun ann) Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

Methods

memoryUsageCekValue uni fun ann → CostRose Source #

type UniOf (CekValue uni fun ann) Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

type UniOf (CekValue uni fun ann) = uni

readKnownCek ∷ (ThrowableBuiltins uni fun, ReadKnown (Term Name uni fun ()) a) ⇒ MachineParameters CekMachineCosts fun (CekValue uni fun ann) → Term Name uni fun ann → Either (CekEvaluationException Name uni fun) a Source #

Unlift a value using the CEK machine. *THIS FUNCTION IS PARTIAL if the input term contains free variables*

class Eq a ⇒ Hashable a Source #

The class of types that can be converted to a hash value.

Minimal implementation: hashWithSalt.

Hashable is intended exclusively for use in in-memory data structures. . Hashable does not have a fixed standard. This allows it to improve over time. . Because it does not have a fixed standard, different computers or computers on different versions of the code will observe different hash values. As such, Hashable is not recommended for use other than in-memory datastructures. Specifically, Hashable is not intended for network use or in applications which persist hashed values. For stable hashing use named hashes: sha256, crc32, xxhash etc.

If you are looking for Hashable instance in time package, check time-compat

Instances

Instances details
Hashable Key 
Instance details

Defined in Data.Aeson.Key

Methods

hashWithSaltInt → Key → Int Source #

hash ∷ Key → Int Source #

Hashable Value 
Instance details

Defined in Data.Aeson.Types.Internal

Methods

hashWithSaltInt → Value → Int Source #

hash ∷ Value → Int Source #

Hashable ByteArray

This instance was available since 1.4.1.0 only for GHC-9.4+

Since: hashable-1.4.2.0

Instance details

Defined in Data.Hashable.Class

Hashable SomeTypeRep 
Instance details

Defined in Data.Hashable.Class

Hashable Unique 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSaltIntUniqueInt Source #

hashUniqueInt Source #

Hashable Version 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSaltIntVersionInt Source #

hashVersionInt Source #

Hashable IntPtr 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSaltIntIntPtrInt Source #

hashIntPtrInt Source #

Hashable WordPtr 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSaltIntWordPtrInt Source #

hashWordPtrInt Source #

Hashable Void 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSaltIntVoidInt Source #

hashVoidInt Source #

Hashable ThreadId 
Instance details

Defined in Data.Hashable.Class

Hashable Fingerprint

Since: hashable-1.3.0.0

Instance details

Defined in Data.Hashable.Class

Hashable Int16 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSaltIntInt16Int Source #

hashInt16Int Source #

Hashable Int32 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSaltIntInt32Int Source #

hashInt32Int Source #

Hashable Int64 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSaltIntInt64Int Source #

hashInt64Int Source #

Hashable Int8 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSaltIntInt8Int Source #

hashInt8Int Source #

Hashable Word16 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSaltIntWord16Int Source #

hashWord16Int Source #

Hashable Word32 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSaltIntWord32Int Source #

hashWord32Int Source #

Hashable Word64 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSaltIntWord64Int Source #

hashWord64Int Source #

Hashable Word8 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSaltIntWord8Int Source #

hashWord8Int Source #

Hashable ByteString 
Instance details

Defined in Data.Hashable.Class

Hashable ByteString 
Instance details

Defined in Data.Hashable.Class

Hashable ShortByteString 
Instance details

Defined in Data.Hashable.Class

Hashable IntSet

Since: hashable-1.3.4.0

Instance details

Defined in Data.Hashable.Class

Methods

hashWithSaltIntIntSetInt Source #

hashIntSetInt Source #

Hashable OsString 
Instance details

Defined in Data.Hashable.Class

Hashable PosixString 
Instance details

Defined in Data.Hashable.Class

Hashable WindowsString 
Instance details

Defined in Data.Hashable.Class

Hashable BigNat 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSaltIntBigNatInt Source #

hashBigNatInt Source #

Hashable Ordering 
Instance details

Defined in Data.Hashable.Class

Hashable OsString

Since: hashable-1.4.2.0

Instance details

Defined in Data.Hashable.Class

Methods

hashWithSaltInt → OsString → Int Source #

hash ∷ OsString → Int Source #

Hashable PosixString

Since: hashable-1.4.2.0

Instance details

Defined in Data.Hashable.Class

Methods

hashWithSaltInt → PosixString → Int Source #

hash ∷ PosixString → Int Source #

Hashable WindowsString

Since: hashable-1.4.2.0

Instance details

Defined in Data.Hashable.Class

Methods

hashWithSaltInt → WindowsString → Int Source #

hash ∷ WindowsString → Int Source #

Hashable Ann Source # 
Instance details

Defined in PlutusCore.Annotation

Methods

hashWithSaltIntAnnInt Source #

hashAnnInt Source #

Hashable Inline Source # 
Instance details

Defined in PlutusCore.Annotation

Methods

hashWithSaltIntInlineInt Source #

hashInlineInt Source #

Hashable SrcSpan Source # 
Instance details

Defined in PlutusCore.Annotation

Methods

hashWithSaltIntSrcSpanInt Source #

hashSrcSpanInt Source #

Hashable SrcSpans Source # 
Instance details

Defined in PlutusCore.Annotation

Hashable Element Source # 
Instance details

Defined in PlutusCore.Crypto.BLS12_381.G1

Methods

hashWithSaltIntElementInt Source #

hashElementInt Source #

Hashable Element Source # 
Instance details

Defined in PlutusCore.Crypto.BLS12_381.G2

Methods

hashWithSaltIntElementInt Source #

hashElementInt Source #

Hashable MlResult Source # 
Instance details

Defined in PlutusCore.Crypto.BLS12_381.Pairing

Hashable Data Source # 
Instance details

Defined in PlutusCore.Data

Methods

hashWithSaltIntDataInt Source #

hashDataInt Source #

Hashable DeBruijn Source # 
Instance details

Defined in PlutusCore.DeBruijn.Internal

Hashable FakeNamedDeBruijn Source # 
Instance details

Defined in PlutusCore.DeBruijn.Internal

Hashable Index Source # 
Instance details

Defined in PlutusCore.DeBruijn.Internal

Methods

hashWithSaltIntIndexInt Source #

hashIndexInt Source #

Hashable NamedDeBruijn Source # 
Instance details

Defined in PlutusCore.DeBruijn.Internal

Hashable DefaultFun Source # 
Instance details

Defined in PlutusCore.Default.Builtins

Hashable ExtensionFun Source # 
Instance details

Defined in PlutusCore.Examples.Builtins

Hashable Name Source # 
Instance details

Defined in PlutusCore.Name.Unique

Methods

hashWithSaltIntNameInt Source #

hashNameInt Source #

Hashable TermUnique Source # 
Instance details

Defined in PlutusCore.Name.Unique

Hashable TyName Source # 
Instance details

Defined in PlutusCore.Name.Unique

Methods

hashWithSaltIntTyNameInt Source #

hashTyNameInt Source #

Hashable TypeUnique Source # 
Instance details

Defined in PlutusCore.Name.Unique

Hashable Unique Source # 
Instance details

Defined in PlutusCore.Name.Unique

Methods

hashWithSaltIntUniqueInt Source #

hashUniqueInt Source #

Hashable Version Source # 
Instance details

Defined in PlutusCore.Version

Methods

hashWithSaltIntVersionInt Source #

hashVersionInt Source #

Hashable StepKind Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

Hashable Scientific 
Instance details

Defined in Data.Scientific

Methods

hashWithSaltInt → Scientific → Int Source #

hash ∷ Scientific → Int Source #

Hashable Text 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSaltIntTextInt Source #

hashTextInt Source #

Hashable Text 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSaltIntTextInt Source #

hashTextInt Source #

Hashable ShortText 
Instance details

Defined in Data.Text.Short.Internal

Methods

hashWithSaltInt → ShortText → Int Source #

hash ∷ ShortText → Int Source #

Hashable UUID 
Instance details

Defined in Data.UUID.Types.Internal

Methods

hashWithSaltInt → UUID → Int Source #

hash ∷ UUID → Int Source #

Hashable Integer 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSaltIntIntegerInt Source #

hashIntegerInt Source #

Hashable Natural 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSaltIntNaturalInt Source #

hashNaturalInt Source #

Hashable () 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSaltInt → () → Int Source #

hash ∷ () → Int Source #

Hashable Bool 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSaltIntBoolInt Source #

hashBoolInt Source #

Hashable Char 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSaltIntCharInt Source #

hashCharInt Source #

Hashable Double

Note: prior to hashable-1.3.0.0, hash 0.0 /= hash (-0.0)

The hash of NaN is not well defined.

Since: hashable-1.3.0.0

Instance details

Defined in Data.Hashable.Class

Methods

hashWithSaltIntDoubleInt Source #

hashDoubleInt Source #

Hashable Float

Note: prior to hashable-1.3.0.0, hash 0.0 /= hash (-0.0)

The hash of NaN is not well defined.

Since: hashable-1.3.0.0

Instance details

Defined in Data.Hashable.Class

Methods

hashWithSaltIntFloatInt Source #

hashFloatInt Source #

Hashable Int 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSaltIntIntInt Source #

hashIntInt Source #

Hashable Word 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSaltIntWordInt Source #

hashWordInt Source #

Hashable v ⇒ Hashable (KeyMap v) 
Instance details

Defined in Data.Aeson.KeyMap

Methods

hashWithSaltInt → KeyMap v → Int Source #

hash ∷ KeyMap v → Int Source #

Hashable a ⇒ Hashable (Complex a) 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSaltIntComplex a → Int Source #

hashComplex a → Int Source #

Hashable a ⇒ Hashable (Identity a) 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSaltIntIdentity a → Int Source #

hashIdentity a → Int Source #

Hashable a ⇒ Hashable (First a) 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSaltIntFirst a → Int Source #

hashFirst a → Int Source #

Hashable a ⇒ Hashable (Last a) 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSaltIntLast a → Int Source #

hashLast a → Int Source #

Hashable a ⇒ Hashable (Max a) 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSaltIntMax a → Int Source #

hashMax a → Int Source #

Hashable a ⇒ Hashable (Min a) 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSaltIntMin a → Int Source #

hashMin a → Int Source #

Hashable a ⇒ Hashable (WrappedMonoid a) 
Instance details

Defined in Data.Hashable.Class

Hashable a ⇒ Hashable (NonEmpty a) 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSaltIntNonEmpty a → Int Source #

hashNonEmpty a → Int Source #

Hashable (FunPtr a) 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSaltIntFunPtr a → Int Source #

hashFunPtr a → Int Source #

Hashable (Ptr a) 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSaltIntPtr a → Int Source #

hashPtr a → Int Source #

Hashable a ⇒ Hashable (Ratio a) 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSaltIntRatio a → Int Source #

hashRatio a → Int Source #

Hashable (StableName a) 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSaltIntStableName a → Int Source #

hashStableName a → Int Source #

Hashable v ⇒ Hashable (IntMap v)

Since: hashable-1.3.4.0

Instance details

Defined in Data.Hashable.Class

Methods

hashWithSaltIntIntMap v → Int Source #

hashIntMap v → Int Source #

Hashable v ⇒ Hashable (Seq v)

Since: hashable-1.3.4.0

Instance details

Defined in Data.Hashable.Class

Methods

hashWithSaltIntSeq v → Int Source #

hashSeq v → Int Source #

Hashable v ⇒ Hashable (Set v)

Since: hashable-1.3.4.0

Instance details

Defined in Data.Hashable.Class

Methods

hashWithSaltIntSet v → Int Source #

hashSet v → Int Source #

Hashable v ⇒ Hashable (Tree v)

Since: hashable-1.3.4.0

Instance details

Defined in Data.Hashable.Class

Methods

hashWithSaltIntTree v → Int Source #

hashTree v → Int Source #

Hashable1 f ⇒ Hashable (Fix f) 
Instance details

Defined in Data.Fix

Methods

hashWithSaltInt → Fix f → Int Source #

hash ∷ Fix f → Int Source #

Eq a ⇒ Hashable (Hashed a) 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSaltIntHashed a → Int Source #

hashHashed a → Int Source #

Hashable ann ⇒ Hashable (Kind ann) Source # 
Instance details

Defined in PlutusCore.Core.Type

Methods

hashWithSaltIntKind ann → Int Source #

hashKind ann → Int Source #

(Closed uni, GEq uni) ⇒ Hashable (SomeTypeIn uni) Source # 
Instance details

Defined in Universe.Core

Methods

hashWithSaltIntSomeTypeIn uni → Int Source #

hashSomeTypeIn uni → Int Source #

Hashable fun ⇒ Hashable (ExBudgetCategory fun) Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

Hashable a ⇒ Hashable (Leaf a) 
Instance details

Defined in Data.RAList.Tree.Internal

Methods

hashWithSaltIntLeaf a → Int Source #

hashLeaf a → Int Source #

Hashable a ⇒ Hashable (Maybe a) 
Instance details

Defined in Data.Strict.Maybe

Methods

hashWithSaltInt → Maybe a → Int Source #

hash ∷ Maybe a → Int Source #

Hashable a ⇒ Hashable (HashSet a) 
Instance details

Defined in Data.HashSet.Internal

Methods

hashWithSaltIntHashSet a → Int Source #

hashHashSet a → Int Source #

Hashable a ⇒ Hashable (Vector a) Source # 
Instance details

Defined in UntypedPlutusCore.Core.Instance.Eq

Methods

hashWithSaltIntVector a → Int Source #

hashVector a → Int Source #

Hashable a ⇒ Hashable (Maybe a) 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSaltIntMaybe a → Int Source #

hashMaybe a → Int Source #

Hashable a ⇒ Hashable (a) 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSaltInt → (a) → Int Source #

hash ∷ (a) → Int Source #

Hashable a ⇒ Hashable [a] 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSaltInt → [a] → Int Source #

hash ∷ [a] → Int Source #

(Hashable a, Hashable b) ⇒ Hashable (Either a b) 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSaltIntEither a b → Int Source #

hashEither a b → Int Source #

Hashable (Fixed a) 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSaltIntFixed a → Int Source #

hashFixed a → Int Source #

Hashable (Proxy a) 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSaltIntProxy a → Int Source #

hashProxy a → Int Source #

Hashable a ⇒ Hashable (Arg a b)

Note: Prior to hashable-1.3.0.0 the hash computation included the second argument of Arg which wasn't consistent with its Eq instance.

Since: hashable-1.3.0.0

Instance details

Defined in Data.Hashable.Class

Methods

hashWithSaltIntArg a b → Int Source #

hashArg a b → Int Source #

Hashable (TypeRep a) 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSaltIntTypeRep a → Int Source #

hashTypeRep a → Int Source #

(Hashable k, Hashable v) ⇒ Hashable (Map k v)

Since: hashable-1.3.4.0

Instance details

Defined in Data.Hashable.Class

Methods

hashWithSaltIntMap k v → Int Source #

hashMap k v → Int Source #

(Hashable k, Hashable a) ⇒ Hashable (MonoidalHashMap k a) 
Instance details

Defined in Data.HashMap.Monoidal

(Closed uni, GEq uni, Everywhere uni Eq, Everywhere uni Hashable) ⇒ Hashable (ValueOf uni a) Source # 
Instance details

Defined in Universe.Core

Methods

hashWithSaltIntValueOf uni a → Int Source #

hashValueOf uni a → Int Source #

Hashable (f a) ⇒ Hashable (Node f a) 
Instance details

Defined in Data.RAList.Tree.Internal

Methods

hashWithSaltIntNode f a → Int Source #

hashNode f a → Int Source #

(Closed uni, GEq uni, Everywhere uni Eq, Everywhere uni Hashable) ⇒ Hashable (Some (ValueOf uni)) Source # 
Instance details

Defined in Universe.Core

Methods

hashWithSaltIntSome (ValueOf uni) → Int Source #

hashSome (ValueOf uni) → Int Source #

(Hashable a, Hashable b) ⇒ Hashable (Either a b) 
Instance details

Defined in Data.Strict.Either

Methods

hashWithSaltInt → Either a b → Int Source #

hash ∷ Either a b → Int Source #

(Hashable a, Hashable b) ⇒ Hashable (These a b) 
Instance details

Defined in Data.Strict.These

Methods

hashWithSaltInt → These a b → Int Source #

hash ∷ These a b → Int Source #

(Hashable a, Hashable b) ⇒ Hashable (Pair a b) 
Instance details

Defined in Data.Strict.Tuple

Methods

hashWithSaltInt → Pair a b → Int Source #

hash ∷ Pair a b → Int Source #

(Hashable a, Hashable b) ⇒ Hashable (These a b) 
Instance details

Defined in Data.These

Methods

hashWithSaltIntThese a b → Int Source #

hashThese a b → Int Source #

(Hashable k, Hashable v) ⇒ Hashable (HashMap k v) 
Instance details

Defined in Data.HashMap.Internal

Methods

hashWithSaltIntHashMap k v → Int Source #

hashHashMap k v → Int Source #

(Hashable a1, Hashable a2) ⇒ Hashable (a1, a2) 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSaltInt → (a1, a2) → Int Source #

hash ∷ (a1, a2) → Int Source #

Hashable a ⇒ Hashable (Const a b) 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSaltIntConst a b → Int Source #

hashConst a b → Int Source #

(Hashable a1, Hashable a2, Hashable a3) ⇒ Hashable (a1, a2, a3) 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSaltInt → (a1, a2, a3) → Int Source #

hash ∷ (a1, a2, a3) → Int Source #

(Hashable1 f, Hashable1 g, Hashable a) ⇒ Hashable (Product f g a) 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSaltIntProduct f g a → Int Source #

hashProduct f g a → Int Source #

(Hashable1 f, Hashable1 g, Hashable a) ⇒ Hashable (Sum f g a) 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSaltIntSum f g a → Int Source #

hashSum f g a → Int Source #

HashableTermConstraints uni fun ann ⇒ Hashable (Term DeBruijn uni fun ann) Source # 
Instance details

Defined in UntypedPlutusCore.Core.Instance.Eq

Methods

hashWithSaltIntTerm DeBruijn uni fun ann → Int Source #

hashTerm DeBruijn uni fun ann → Int Source #

HashableTermConstraints uni fun ann ⇒ Hashable (Term FakeNamedDeBruijn uni fun ann) Source # 
Instance details

Defined in UntypedPlutusCore.Core.Instance.Eq

Methods

hashWithSaltIntTerm FakeNamedDeBruijn uni fun ann → Int Source #

hashTerm FakeNamedDeBruijn uni fun ann → Int Source #

HashableTermConstraints uni fun ann ⇒ Hashable (Term NamedDeBruijn uni fun ann) Source # 
Instance details

Defined in UntypedPlutusCore.Core.Instance.Eq

Methods

hashWithSaltIntTerm NamedDeBruijn uni fun ann → Int Source #

hashTerm NamedDeBruijn uni fun ann → Int Source #

HashableTermConstraints uni fun ann ⇒ Hashable (Term Name uni fun ann) Source # 
Instance details

Defined in UntypedPlutusCore.Core.Instance.Eq

Methods

hashWithSaltIntTerm Name uni fun ann → Int Source #

hashTerm Name uni fun ann → Int Source #

(Hashable a1, Hashable a2, Hashable a3, Hashable a4) ⇒ Hashable (a1, a2, a3, a4) 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSaltInt → (a1, a2, a3, a4) → Int Source #

hash ∷ (a1, a2, a3, a4) → Int Source #

(Hashable1 f, Hashable1 g, Hashable a) ⇒ Hashable (Compose f g a)

In general, hash (Compose x) ≠ hash x. However, hashWithSalt satisfies its variant of this equivalence.

Instance details

Defined in Data.Hashable.Class

Methods

hashWithSaltIntCompose f g a → Int Source #

hashCompose f g a → Int Source #

(Hashable a1, Hashable a2, Hashable a3, Hashable a4, Hashable a5) ⇒ Hashable (a1, a2, a3, a4, a5) 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSaltInt → (a1, a2, a3, a4, a5) → Int Source #

hash ∷ (a1, a2, a3, a4, a5) → Int Source #

(Hashable a1, Hashable a2, Hashable a3, Hashable a4, Hashable a5, Hashable a6) ⇒ Hashable (a1, a2, a3, a4, a5, a6) 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSaltInt → (a1, a2, a3, a4, a5, a6) → Int Source #

hash ∷ (a1, a2, a3, a4, a5, a6) → Int Source #

(Hashable a1, Hashable a2, Hashable a3, Hashable a4, Hashable a5, Hashable a6, Hashable a7) ⇒ Hashable (a1, a2, a3, a4, a5, a6, a7) 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSaltInt → (a1, a2, a3, a4, a5, a6, a7) → Int Source #

hash ∷ (a1, a2, a3, a4, a5, a6, a7) → Int Source #

type ThrowableBuiltins uni fun = (PrettyUni uni, Pretty fun, Typeable uni, Typeable fun) Source #

The set of constraints we need to be able to throw exceptions with things with built-in types and functions in them.