/usr/lib/ocaml/lwt/lwt_result.mli is in liblwt-ocaml-dev 2.7.1-4build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | (* Lightweight thread library for OCaml
* http://www.ocsigen.org/lwt
*
* Copyright (C) 2016 Simon Cruanes
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, with linking exceptions;
* either version 2.1 of the License, or (at your option) any later
* version. See COPYING file for details.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*)
(** Module [Lwt_result]: explicit error handling *)
(** This module provides helpers for values of type [('a, 'b) result Lwt.t].
The module is experimental and may change in the future. *)
type (+'a, +'b) t = ('a, 'b) Result.result Lwt.t
val return : 'a -> ('a, _) t
val fail : 'b -> (_, 'b) t
val lift : ('a, 'b) Result.result -> ('a, 'b) t
val ok : 'a Lwt.t -> ('a, _) t
val catch : 'a Lwt.t -> ('a, exn) t
(** [catch x] behaves like [return y] if [x] evaluates to [y],
and like [fail e] if [x] raises [e] *)
val get_exn : ('a, exn) t -> 'a Lwt.t
(** [get_exn] is the opposite of {!catch}: it unwraps the result type,
returning the value in case of success, calls {!Lwt.fail} in
case of error. *)
val map : ('a -> 'b) -> ('a,'e) t -> ('b,'e) t
val map_err : ('e1 -> 'e2) -> ('a,'e1) t -> ('a,'e2) t
val bind : ('a,'e) t -> ('a -> ('b,'e) t) -> ('b,'e) t
val bind_lwt : ('a,'e) t -> ('a -> 'b Lwt.t) -> ('b,'e) t
val bind_lwt_err : ('a,'e1) t -> ('e1 -> 'e2 Lwt.t) -> ('a,'e2) t
val bind_result : ('a,'e) t -> ('a -> ('b,'e) Result.result) -> ('b,'e) t
module Infix : sig
val (>|=) : ('a,'e) t -> ('a -> 'b) -> ('b,'e) t
val (>>=) : ('a,'e) t -> ('a -> ('b,'e) t) -> ('b,'e) t
end
include module type of Infix
|