package core_extended

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Maps with mutliple bindings.

This is a map that allows multiple binding. Each key can have several values associated to it.

type ('k, 'v) t
include Core.Sexpable.S2 with type ('a, 'b) t := ('a, 'b) t
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 empty : ('k, 'v) t
val singleton : 'k -> 'v -> ('k, 'v) t
val is_empty : ('k, 'v) t -> bool
val add : key:'k -> data:'v -> ('k, 'v) t -> ('k, 'v) t
val find : ('k, 'v) t -> 'k -> 'v list

find m key returns all the elements that where added to key in m in the reverse order in which they where added. If no element where added an empty list is returned.

val remove : ('k, 'v) t -> 'k -> ('k, 'v) t

remove m key Remove all the values associated the key key in m

val set : key:'k -> data:'v list -> ('k, 'v) t -> ('k, 'v) t
val mem : ('k, 'v) t -> 'k -> bool

mem m key returns true if key has at last one value associated to it in m

val keys : ('k, 'v) t -> 'k list

Returns all the non-empty keys in m.

val iter : f:('v -> unit) -> (_, 'v) t -> unit
val iteri : f:(key:'k -> data:'v -> unit) -> ('k, 'v) t -> unit
val iter_keys : f:('k -> unit) -> ('k, _) t -> unit
val map : f:('a -> 'b) -> ('k, 'a) t -> ('k, 'b) t
val mapi : f:(key:'k -> data:'a -> 'b) -> ('k, 'a) t -> ('k, 'b) t
val fold : f:(key:'k -> data:'v -> 'a -> 'a) -> ('k, 'v) t -> init:'a -> 'a
val filter : f:('v -> bool) -> ('k, 'v) t -> ('k, 'v) t
val filteri : f:(key:'k -> data:'v -> bool) -> ('k, 'v) t -> ('k, 'v) t
val filter_keys : f:('k -> bool) -> ('k, 'v) t -> ('k, 'v) t
val reduce : f:('v list -> 'r) -> ('k, 'v) t -> ('k, 'r) Core.Map.Poly.t
OCaml

Innovation. Community. Security.