Lwt_utils: add may

This commit is contained in:
Vincent Bernardoff 2016-11-29 16:39:53 +01:00
parent ec922f6821
commit 199bd93696
2 changed files with 7 additions and 2 deletions

View File

@ -8,10 +8,13 @@
(**************************************************************************)
module LC = Lwt_condition
open Lwt.Infix
open Logging.Core
let (>>=) = Lwt.(>>=)
let (>|=) = Lwt.(>|=)
let may f = function
| None -> Lwt.return_unit
| Some x -> f x
let never_ending = fst (Lwt.wait ())

View File

@ -7,6 +7,8 @@
(* *)
(**************************************************************************)
val may : ('a -> unit Lwt.t) -> 'a option -> unit Lwt.t
val never_ending: 'a Lwt.t
val canceler : unit ->