package ringo-lwt

  1. Overview
  2. Docs

Module Functors.Make_optSource

This is similar to CACHE_MAP except that it handles option. Specifically, you can insert 'a option Lwt.t and promises that are fulfilled with None are treated like promises that are rejected:

  • They are removed from the cache automatically.
  • They are not folded over by fold.

Parameters

Signature

Sourcetype key = C.key
Sourcetype 'a t
Sourceval create : int -> 'a t
Sourceval replace : 'a t -> key -> 'a option Lwt.t -> unit
Sourceval fold : (key -> 'a -> 'b -> 'b Lwt.t) -> 'a t -> 'b -> 'b Lwt.t
Sourceval fold_promises : (key -> 'a option Lwt.t -> 'b -> 'b) -> 'a t -> 'b -> 'b
Sourceval find_opt : 'a t -> key -> 'a option Lwt.t option
Sourceval find_or_replace : 'a t -> key -> (key -> 'a option Lwt.t) -> 'a option Lwt.t
Sourceval remove : 'a t -> key -> unit
Sourceval length : 'a t -> int
Sourceval capacity : 'a t -> int
Sourceval clear : 'a t -> unit
OCaml

Innovation. Community. Security.