liqwid-plutarch-extra-3.21.1: A collection of Plutarch extras from Liqwid Labs
Safe HaskellSafe-Inferred
LanguageHaskell2010

Plutarch.Extra.DebuggableScript

Synopsis

Type

data DebuggableScript Source #

A Script with a debug fallback that has tracing turned on.

Since: 3.8.0

Instances

Instances details
Generic DebuggableScript Source # 
Instance details

Defined in Plutarch.Extra.DebuggableScript

Associated Types

type Rep DebuggableScript :: Type -> Type Source #

Show DebuggableScript Source #

Since: 3.0.2

Instance details

Defined in Plutarch.Extra.DebuggableScript

Eq DebuggableScript Source #

Since: 3.0.2

Instance details

Defined in Plutarch.Extra.DebuggableScript

(k ~ A_Getter, a ~ Script, b ~ Script) => LabelOptic "debugScript" k DebuggableScript DebuggableScript a b Source #

Retrieves the debugging Script. This is read-only, as allowing it to change could break invariants.

Since: 3.8.0

Instance details

Defined in Plutarch.Extra.DebuggableScript

(k ~ A_Getter, a ~ Script, b ~ Script) => LabelOptic "script" k DebuggableScript DebuggableScript a b Source #

Retrieves the non-debugging Script. This is read-only, as allowing it to change could break invariants.

Since: 3.8.0

Instance details

Defined in Plutarch.Extra.DebuggableScript

type Rep DebuggableScript Source #

Since: 3.0.2

Instance details

Defined in Plutarch.Extra.DebuggableScript

type Rep DebuggableScript = D1 ('MetaData "DebuggableScript" "Plutarch.Extra.DebuggableScript" "liqwid-plutarch-extra-3.21.1-KPadsMN5oqEA2Ctxwq6qig" 'False) (C1 ('MetaCons "DebuggableScript" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Script) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Script)))

Construction

checkedCompileD :: forall (a :: S -> Type). (forall (s :: S). Term s a) -> Either Text DebuggableScript Source #

For handling compilation errors right away.

You pay for the compilation of the debug script, even if it's not needed down the line. You most likely want mustCompileD instead.

Since: 3.0.2

mustCompileD :: forall (a :: S -> Type). (forall (s :: S). Term s a) -> DebuggableScript Source #

Compilation errors cause exceptions, but deferred by lazyness.

You don't pay for compilation of the debug script if it's not needed!

Since: 3.0.2

Use

applyScript :: Script -> Script -> Script Source #

Apply a function to an argument on the compiled Script level.

Since: 3.8.0

applyDebuggableScript :: DebuggableScript -> [Data] -> DebuggableScript Source #

Apply given arguments to DebuggableScript.

Since: 3.7.1

applyDebuggableArg :: DebuggableScript -> DebuggableScript -> DebuggableScript Source #

Apply a single argument, provided as a DebuggableScript.

Since: 3.8.0

mustFinalEvalDebuggableScript :: DebuggableScript -> Script Source #

Final evaluation of a DebuggableScript to a Script, with errors resulting in exceptions.

Since: 3.0.2

finalEvalDebuggableScript :: DebuggableScript -> (Either EvalError Script, ExBudget, [Text]) Source #

Final evaluation of a DebuggableScript, with full evalScript result.

Falls back to the debug script if a UserEvaluationError occurs. Verifies that the debug script results in a UserEvaluationError too, throws an exception otherwise.

Since: 3.0.2

mustEvalScript :: Script -> Script Source #

Evaluate a Script to a Script, with errors resulting in exceptions.

This is mostly useful for pre-evaluating arguments to a thing being tested/benchmarked.

Since: 3.0.2

mustEvalD :: DebuggableScript -> DebuggableScript Source #

Evaluate a DebuggableScript to a DebuggableScript, with errors resulting in exceptions.

This is mostly useful for pre-evaluating arguments to a thing being tested/benchmarked. Lazyness defers the evaluation (and exception) until it's needed, so the debug script causes no unneccessary work.

Since: 3.0.2