package tezos-protocol-016-PtMumbai

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

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

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

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.

OCaml

Innovation. Community. Security.