package octez-libs

  1. Overview
  2. Docs
A package that contains multiple base libraries used by the Octez suite

Install

Dune Dependency

Authors

Maintainers

Sources

octez-19.0.tar.gz
sha256=c6df840ebbf115e454db949028c595bec558a59a66cade73b52a6d099d6fa4d4
sha512=d8aee903b9fe130d73176bc8ec38b78c9ff65317da3cb4f3415f09af0c625b4384e7498201fdb61aa39086a7d5d409d0ab3423f9bc3ab989a680cf444a79bc13

doc/octez-libs.lwt-result-stdlib/Tezos_lwt_result_stdlib/Lwtreslib/Bare/Monad/Lwt_syntax/index.html

Module Monad.Lwt_syntax

Syntax module for Lwt. This is intended to be opened locally in functions which use Lwt for control-flow. Within the scope of this module, the code can include binding operators, leading to a let-style syntax.

See also Lwt and Lwt.Syntax

val return : 'a -> 'a Lwt.t

return x is an Lwt promise that is already resolved to x. return is an alias for Lwt.return.

val return_unit : unit Lwt.t

return_unit is an Lwt promise that is already resolved to (). It is an alias for Lwt.return_unit.

val return_none : _ option Lwt.t

return_none is an Lwt promise that is already resolved to None. It is an alias for Lwt.return_none.

val return_nil : _ list Lwt.t

return_nil is an Lwt promise that is already resolved to []. It is an alias for Lwt.return_nil.

val return_true : bool Lwt.t

return_true is an Lwt promise that is already resolved to true. It is an alias for Lwt.return_true.

val return_false : bool Lwt.t

return_false is an Lwt promise that is already resolved to false. It is an alias for Lwt.return_false.

val return_some : 'a -> 'a option Lwt.t

return_some x is an Lwt promise that is already resolved to Some x. return_some is an alias for Lwt.return_some.

val return_ok : 'a -> ('a, _) result Lwt.t

return_ok x is an Lwt promise that is already resolved to Ok x. return_ok is an alias for Lwt.return_ok.

val return_error : 'e -> (_, 'e) result Lwt.t

return_error x is an Lwt promise that is already resolved to Error x. return_error is an alias for Lwt.return_error.

The following return_ok_* functions are intended to be used within the scope of Lwt_syntax when returning results compatible with Lwt_result_syntax.

val return_ok_unit : (unit, 'e) result Lwt.t

return_ok_unit is an Lwt promise that is already resolved to Ok ().

val return_ok_true : (bool, 'e) result Lwt.t

return_ok_true is an Lwt promise that is already resolved to Ok true.

val return_ok_false : (bool, 'e) result Lwt.t

return_ok_false is an Lwt promise that is already resolved to Ok false.

val return_ok_none : ('a option, 'e) result Lwt.t

return_ok_none is an Lwt promise that is already resolved to Ok None.

val return_ok_nil : ('a list, 'e) result Lwt.t

return_ok_nil is an Lwt promise that is already resolved to Ok [].

val (let*) : 'a Lwt.t -> ('a -> 'b Lwt.t) -> 'b Lwt.t

let* is a binding operator alias for Lwt.bind and Lwt.(>>=).

val (and*) : 'a Lwt.t -> 'b Lwt.t -> ('a * 'b) Lwt.t

and* is a binding operator alias for Lwt.both and Lwt.(<&>).

val (let+) : 'a Lwt.t -> ('a -> 'b) -> 'b Lwt.t

let+ is a binding operator alias for Lwt.map and Lwt.(>|=).

val (and+) : 'a Lwt.t -> 'b Lwt.t -> ('a * 'b) Lwt.t

and+ is a binding operator alias for Lwt.both and Lwt.(<&>).

val join : unit Lwt.t list -> unit Lwt.t

join is the joining of concurrent unit values (it is Lwt.join).

val all : 'a Lwt.t list -> 'a list Lwt.t

all is the joining of concurrent non-unit values (it is Lwt.all).

val both : 'a Lwt.t -> 'b Lwt.t -> ('a * 'b) Lwt.t

both is the joining of two concurrent non-unit values (it is Lwt.both).

OCaml

Innovation. Community. Security.