package containers

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

Module type CCHashTrie.SSource

Signature

Sourcetype key
Sourcetype 'a t
Sourceval empty : 'a t
Sourceval is_empty : _ t -> bool
Sourceval singleton : key -> 'a -> 'a t
Sourceval add : key -> 'a -> 'a t -> 'a t
Sourceval mem : key -> _ t -> bool
Sourceval get : key -> 'a t -> 'a option
Sourceval get_exn : key -> 'a t -> 'a
Sourceval remove : key -> 'a t -> 'a t

Remove the key, if present.

Sourceval update : key -> f:('a option -> 'a option) -> 'a t -> 'a t

update k ~f m calls f (Some v) if get k m = Some v, f None otherwise. Then, if f returns Some v' it binds k to v', if f returns None it removes k.

Sourceval add_mut : id:Transient.t -> key -> 'a -> 'a t -> 'a t

add_mut ~id k v m behaves like add k v m, except it will mutate in place whenever possible. Changes done with an id might affect all versions of the structure obtained with the same id (but not other versions).

Sourceval remove_mut : id:Transient.t -> key -> 'a t -> 'a t

Same as remove, but modifies in place whenever possible.

Sourceval update_mut : id:Transient.t -> key -> f:('a option -> 'a option) -> 'a t -> 'a t

Same as update but with mutability.

Sourceval cardinal : _ t -> int
Sourceval choose : 'a t -> (key * 'a) option
Sourceval choose_exn : 'a t -> key * 'a
Sourceval iter : f:(key -> 'a -> unit) -> 'a t -> unit
Sourceval fold : f:('b -> key -> 'a -> 'b) -> x:'b -> 'a t -> 'b
Conversions
Sourceval to_list : 'a t -> (key * 'a) list
Sourceval add_list : 'a t -> (key * 'a) list -> 'a t
Sourceval add_list_mut : id:Transient.t -> 'a t -> (key * 'a) list -> 'a t
  • raises Frozen

    if the ID is frozen.

Sourceval of_list : (key * 'a) list -> 'a t
Sourceval add_seq : 'a t -> (key * 'a) sequence -> 'a t
Sourceval add_seq_mut : id:Transient.t -> 'a t -> (key * 'a) sequence -> 'a t
  • raises Frozen

    if the ID is frozen.

Sourceval of_seq : (key * 'a) sequence -> 'a t
Sourceval to_seq : 'a t -> (key * 'a) sequence
Sourceval add_gen : 'a t -> (key * 'a) gen -> 'a t
Sourceval add_gen_mut : id:Transient.t -> 'a t -> (key * 'a) gen -> 'a t
  • raises Frozen

    if the ID is frozen.

Sourceval of_gen : (key * 'a) gen -> 'a t
Sourceval to_gen : 'a t -> (key * 'a) gen
IO
Sourceval pp : key printer -> 'a printer -> 'a t printer

Renamed from val print.

  • since 2.0
Sourceval as_tree : 'a t -> [ `L of int * (key * 'a) list | `N ] ktree

For debugging purpose: explore the structure of the tree, with `L (h,l) being a leaf (with shared hash h) and `N an inner node.

OCaml

Innovation. Community. Security.