= 1024" x-on:close-sidebar="sidebar=window.innerWidth >= 1024 && true">
ON THIS PAGE
Legend:
Library
Module
Module type
Parameter
Class
Class type
Library
Module
Module type
Parameter
Class
Class type
Polymorphic Maps and Multimaps
Basics
type ('a, +'b) t = private {
is_empty : unit -> bool;
size : unit -> int;
get_exn : 'a -> 'b;
iter : ('a -> 'b -> unit) -> unit;
fold : 'c. ('c -> 'a -> 'b -> 'c) -> 'c -> 'c;
choose : unit -> ('a * 'b) option;
}
Map from keys of type 'a
to values of type 'b
the type might change, it is exposed merely for variance checks w.r.t GADTs. Do not access fields directly.
type ('a, +'b) map = ('a, 'b) t
val get : ('a, 'b) t -> 'a -> 'b option
val get_exn : ('a, 'b) t -> 'a -> 'b
val mem : ('a, _) t -> 'a -> bool
val size : (_, _) t -> int
val to_list : ('a, 'b) t -> ('a * 'b) list
val to_rev_list : ('a, 'b) t -> ('a * 'b) list
val fold : ('acc -> 'a -> 'b -> 'acc) -> 'acc -> ('a, 'b) t -> 'acc
Fold on the items of the map
val fold_multimap :
('acc -> 'a -> 'b -> 'acc) ->
'acc ->
('a, 'b list) t ->
'acc
Fold on the items of the multimap
val iter : ('a, 'b) t -> ('a -> 'b -> unit) -> unit
View a multimap as a proper collection
val choose : ('a, 'b) t -> ('a * 'b) option
Build
Used to build new maps
module Build : sig ... end
Misc
Reverse relation of the map, as a multimap
Reverse relation of the multimap
View a multimap as a collection of individual key/value pairs