package anycache-lwt

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type 'a t = 'a Lwt.t

the type for deferred computation with result of type 'a

type ('a, 'b) result = ('a, 'b) Result.result =
  1. | Ok of 'a
  2. | Error of 'b
    (*

    result type for backward compatibility

    *)
val return : 'a -> 'a t

a successfull result

val fail : exn -> 'a t

an error

val (>>?) : 'a t -> (('a, exn) result -> 'b t) -> 'b t

v >>= g chains the computation of v and the function g. When the computation of v finishes g is invoked with its result, or error. This allows to post-process the result or perform error handling.

OCaml

Innovation. Community. Security.