Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Source file map.ml
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156(*****************************************************************************)(* *)(* Open Source License *)(* Copyright (c) 2020 Nomadic Labs <contact@nomadic-labs.com> *)(* *)(* Permission is hereby granted, free of charge, to any person obtaining a *)(* copy of this software and associated documentation files (the "Software"),*)(* to deal in the Software without restriction, including without limitation *)(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *)(* and/or sell copies of the Software, and to permit persons to whom the *)(* Software is furnished to do so, subject to the following conditions: *)(* *)(* The above copyright notice and this permission notice shall be included *)(* in all copies or substantial portions of the Software. *)(* *)(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*)(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *)(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *)(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*)(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *)(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *)(* DEALINGS IN THE SOFTWARE. *)(* *)(*****************************************************************************)(** Maps with the signature [S] are exception-safe replacements for
maps with the {!Stdlib.Map.S} signature with Lwt- and result-aware
traversal functions.
See {!Lwtreslib}'s introductory documentation for explanations regarding
[_e]-, [_s]-, [_es]-, [_p]-, and [_ep]-suffixed functions and exception
safety. See {!Stdlib.Map.S} for explanations regarding OCaml's
maps in general. *)moduletypeS=sigtypekeytype+'atmoduleLegacy:Stdlib.Map.Swithtypekey=keyandtype'at='atvalempty:'atvalis_empty:'at->boolvalmem:key->'at->boolvaladd:key->'a->'at->'atvalupdate:key->('aoption->'aoption)->'at->'atvalsingleton:key->'a->'atvalremove:key->'at->'atvalmerge:(key->'aoption->'boption->'coption)->'at->'bt->'ctvalunion:(key->'a->'a->'aoption)->'at->'at->'atvalcompare:('a->'a->int)->'at->'at->intvalequal:('a->'a->bool)->'at->'at->boolvaliter:(key->'a->unit)->'at->unit(** [iter_e f m] applies [f] to the bindings of [m] one by one in an
unspecified order. If all the applications result in [Ok ()], then the
result of the iteration is [Ok ()]. If any of the applications results in
[Error e] then the iteration stops and the result of the iteration is
[Error e]. *)valiter_e:(key->'a->(unit,'trace)result)->'at->(unit,'trace)resultvaliter_s:(key->'a->unitLwt.t)->'at->unitLwt.tvaliter_p:(key->'a->unitLwt.t)->'at->unitLwt.t(** [iter_es f m] applies [f] to the bindings of [m] in an unspecified order,
one after the other as the promises resolve. If all the applications
result in [Ok ()], then the result of the iteration is [Ok ()]. If any of
the applications results in [Error e] then the iteration stops and the
result of the iteration is [Error e]. *)valiter_es:(key->'a->(unit,'trace)resultLwt.t)->'at->(unit,'trace)resultLwt.t(** [iter_ep f m] applies [f] to the bindings of [m]. All the applications are
done concurrently. If all the applications result in [Ok ()], then the
result of the iteration is [Ok ()]. If any of the applications results in
[Error e] then the result of the iteration is [Error e]. *)valiter_ep:(key->'a->(unit,'error)resultLwt.t)->'at->(unit,'errorlist)resultLwt.tvalfold:(key->'a->'b->'b)->'at->'b->'b(** [fold_e f m init] is
[f k1 d1 init >>? fun acc -> f k2 d2 acc >>? fun acc -> …] where [kN] is
the key bound to [dN] in [m]. *)valfold_e:(key->'a->'b->('b,'trace)result)->'at->'b->('b,'trace)resultvalfold_s:(key->'a->'b->'bLwt.t)->'at->'b->'bLwt.t(** [fold_es f m init] is
[f k1 d1 init >>=? fun acc -> f k2 d2 acc >>=? fun acc -> …] where [kN] is
the key bound to [dN] in [m]. *)valfold_es:(key->'a->'b->('b,'trace)resultLwt.t)->'at->'b->('b,'trace)resultLwt.tvalfor_all:(key->'a->bool)->'at->boolvalexists:(key->'a->bool)->'at->boolvalfilter:(key->'a->bool)->'at->'atvalpartition:(key->'a->bool)->'at->'at*'atvalcardinal:'at->intvalbindings:'at->(key*'a)listvalmin_binding:'at->(key*'a)optionvalmax_binding:'at->(key*'a)optionvalchoose:'at->(key*'a)optionvalsplit:key->'at->'at*'aoption*'atvalfind:key->'at->'aoptionvalfind_first:(key->bool)->'at->(key*'a)optionvalfind_last:(key->bool)->'at->(key*'a)optionvalmap:('a->'b)->'at->'btvalmapi:(key->'a->'b)->'at->'btvalto_seq:'at->(key*'a)Stdlib.Seq.tvalto_seq_from:key->'at->(key*'a)Stdlib.Seq.tvaladd_seq:(key*'a)Stdlib.Seq.t->'at->'atvalof_seq:(key*'a)Stdlib.Seq.t->'atend