package tezos-protocol-016-PtMumbai

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

The necessary monadic operators the storage monad is required to provide.

val let+ : 'a m -> ('a -> 'b) -> 'b m
val let* : 'a m -> ('a -> 'b m) -> 'b m

let*? is for binding the value from Result-only expressions into the storage monad.

fail err shortcuts the current computation by raising an error.

Said error can be handled with the catch combinator.

val catch : 'a m -> ('a -> 'b m) -> (Tezos_protocol_environment_016_PtMumbai.Error_monad.error -> 'b m) -> 'b m

catch p k h tries to executes the monadic computation p. If p terminates without an error, then its result is passed to the continuation k. On the contrary, if an error err is raised, it is passed to the error handler h.

val return : 'a -> 'a m

return x is the simplest computation inside the monad m which simply computes x and nothing else.

val list_fold_left_m : ('a -> 'b -> 'a m) -> 'a -> 'b list -> 'a m

list_fold_left_m f is a monadic version of List.fold_left f, wherein f is not a pure computation, but a computation in the monad m.

fail_unless cond err raises err iff cond is false.

fail_when cond err raises err iff cond is true.

OCaml

Innovation. Community. Security.