Module Gas_monad.Syntax

Syntax module for the Gas_monad. This is intended to be opened locally in functions. Within the scope of this module, the code can include binding operators, leading to a let-style syntax. Similar to Lwt_result_syntax and other syntax modules.

val return : 'a -> ('a, 'trace) t

return x returns a value in the gas-monad.

val return_unit : (unit, 'trace) t

return_unit is return () .

val return_none : ('a option, 'trace) t

return_none is return None .

val return_some : 'a -> ('a option, 'trace) t

return_some x is return (Some x) .

val return_nil : ('a list, 'trace) t

return_nil is return [] .

val return_true : (bool, 'trace) t

return_true is return true .

val return_false : (bool, 'trace) t

return_false is return false .

val fail : 'trace -> ('a, 'trace) t

fail e is return (Error e) .

val let* : ('a, 'trace) t -> ('a -> ('b, 'trace) t) -> ('b, 'trace) t

let* is a binding operator alias for bind.

val let+ : ('a, 'trace) t -> ('a -> 'b) -> ('b, 'trace) t

let+ is a binding operator alias for map.

val let*? : ('a, 'trace) Mavryk_protocol_environment_001_PtAtLas.Pervasives.result -> ('a -> ('b, 'trace) t) -> ('b, 'trace) t

let*? is for binding the value from result-only expressions into the gas-monad.