package core_kernel

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type ('a, 'b) t = ('a, 'b) Base.List.Assoc.t
include sig ... end
val bin_read_t : 'a Bin_prot.Read.reader -> 'b Bin_prot.Read.reader -> ('a, 'b) t Bin_prot.Read.reader
val __bin_read_t__ : 'a Bin_prot.Read.reader -> 'b Bin_prot.Read.reader -> (int -> ('a, 'b) t) Bin_prot.Read.reader
val bin_size_t : 'a Bin_prot.Size.sizer -> 'b Bin_prot.Size.sizer -> ('a, 'b) t Bin_prot.Size.sizer
val compare : ('a -> 'a -> int) -> ('b -> 'b -> int) -> ('a, 'b) t -> ('a, 'b) t -> int
  • deprecated [since 2016-06] This does not respect the equivalence class promised by List.Assoc. Use List.compare directly if that's what you want.
include module type of struct include Base.List.Assoc end with type ('a, 'b) t := ('a, 'b) t

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... 

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 sig ... end
val t_of_sexp : (Base.Sexp.t -> 'a) -> (Base.Sexp.t -> 'b) -> Base.Sexp.t -> ('a, 'b) t
val sexp_of_t : ('a -> Base.Sexp.t) -> ('b -> Base.Sexp.t) -> ('a, 'b) t -> Base.Sexp.t
val add : ('a, 'b) t -> equal:('a -> 'a -> bool) -> 'a -> 'b -> ('a, 'b) 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
val remove : ('a, 'b) t -> equal:('a -> 'a -> bool) -> 'a -> ('a, 'b) t
val map : ('a, 'b) t -> f:('b -> 'c) -> ('a, 'c) t
val inverse : ('a, 'b) t -> ('b, 'a) t

Bijectivity is not guaranteed because we allow a key to appear more than once.