List.Assoc
Interpret a list of (key, value) pairs as a map in which only the first occurrence of a key affects the semantics, i.e.:
List.Assoc.xxx alist ...args...
is always the same as (or at least sort of isomorphic to):
Map.xxx (alist |> Map.of_alist_multi |> Map.map ~f:List.hd) ...args...
include Sexplib0.Sexpable.S2 with type ('a, 'b) t := ('a, 'b) t
val t_of_sexp :
(Sexplib0.Sexp.t -> 'a) ->
(Sexplib0.Sexp.t -> 'b) ->
Sexplib0.Sexp.t ->
('a, 'b) t
val sexp_of_t :
('a -> Sexplib0.Sexp.t) ->
('b -> Sexplib0.Sexp.t) ->
('a, 'b) t ->
Sexplib0.Sexp.t
val t_sexp_grammar :
'a Sexplib0.Sexp_grammar.t ->
'b Sexplib0.Sexp_grammar.t ->
('a, 'b) t Sexplib0.Sexp_grammar.t
val find : ('a, 'b) t -> equal:('a -> 'a -> bool) -> 'a -> 'b option
val find_exn : ('a, 'b) t -> equal:('a -> 'a -> bool) -> 'a -> 'b
val mem : ('a, 'b) t -> equal:('a -> 'a -> bool) -> 'a -> bool
Bijectivity is not guaranteed because we allow a key to appear more than once.
val group : ('a * 'b) list -> equal:('a -> 'a -> bool) -> ('a, 'b list) t
Converts an association list with potential consecutive duplicate keys into an association list of (non-empty) lists with no (consecutive) duplicate keys. Any non-consecutive duplicate keys in the input will remain in the output.
val sort_and_group :
('a * 'b) list ->
compare:('a -> 'a -> int) ->
('a, 'b list) t
Converts an association list with potential duplicate keys into an association list of (non-empty) lists with no duplicate keys.