package containers

  1. Overview
  2. Docs
On This Page
  1. Polymorphic Maps
Legend:
Library
Module
Module type
Parameter
Class
Class type

Polymorphic Maps

type ('a, 'b) t
val get : ('a, 'b) t -> 'a -> 'b option
val size : (_, _) t -> int
val to_seq : ('a, 'b) t -> ('a * 'b) sequence
val map : ('b -> 'c) -> ('a, 'b) t -> ('a, 'c) t

Transform values

val to_list : ('a, 'b) t -> ('a * 'b) list
val reverse : ?cmp:'b ord -> ?eq:'b equal -> ?hash:'b hash -> unit -> ('a, 'b) t -> ('b, 'a list) t

Reverse relation of the map, as a multimap

val reverse_multimap : ?cmp:'b ord -> ?eq:'b equal -> ?hash:'b hash -> unit -> ('a, 'b list) t -> ('b, 'a list) t

Reverse relation of the multimap

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 get_seq : 'a -> ('a, 'b) t -> 'b sequence

Select a key from a map and wrap into sequence

val iter : ('a, 'b) t -> ('a * 'b) sequence

View a multimap as a proper collection

val flatten : ('a, 'b sequence) t -> ('a * 'b) sequence

View a multimap as a collection of individual key/value pairs

val flatten_l : ('a, 'b list) t -> ('a * 'b) sequence

View a multimap as a list of individual key/value pairs

OCaml

Innovation. Community. Security.