Library MonadVM.Support.ResultNotation
Sequential notation for the executor's result monad.
let* x := action in next returns an error immediately if action
fails; otherwise next receives its successful result as x. These
notations expand to the existing generated bind and return functions.
Require Import MonadVM.Result.
Declare Scope execution_result_scope.
Delimit Scope execution_result_scope with execution_result.
Notation "'let*' x ':=' action 'in' next" :=
(MonadVM.Result.op_letdollar action (fun x ⇒ next))
(at level 200, x ident, action at level 100, next at level 200)
: execution_result_scope.
Notation "'let*' ' p ':=' action 'in' next" :=
(MonadVM.Result.op_letdollar action (fun p ⇒ next))
(at level 200, p pattern, action at level 100, next at level 200)
: execution_result_scope.
Notation "'return' value" := (MonadVM.Result._return value)
(at level 10, value at level 9) : execution_result_scope.
Declare Scope execution_result_scope.
Delimit Scope execution_result_scope with execution_result.
Notation "'let*' x ':=' action 'in' next" :=
(MonadVM.Result.op_letdollar action (fun x ⇒ next))
(at level 200, x ident, action at level 100, next at level 200)
: execution_result_scope.
Notation "'let*' ' p ':=' action 'in' next" :=
(MonadVM.Result.op_letdollar action (fun p ⇒ next))
(at level 200, p pattern, action at level 100, next at level 200)
: execution_result_scope.
Notation "'return' value" := (MonadVM.Result._return value)
(at level 10, value at level 9) : execution_result_scope.