package devkit

  1. Overview
  2. Docs

One-to-one associations

type ('a, 'b) t
val create : unit -> ('a, 'b) t
val add : ('a, 'b) t -> 'a -> 'b -> unit

Add association, assert on duplicate key

val get : ('a, 'b) t -> 'a -> 'b

Get associated value,

val try_get : ('a, 'b) t -> 'a -> 'b option

Get associated value

val del : ('a, 'b) t -> 'a -> 'b

Delete association, assert if key is not present,

  • returns

    associated value

val remove : ('a, 'b) t -> 'a -> unit

Delete association, assert if key is not present

val size : ('a, 'b) t -> int
val fold : ('a -> 'b -> 'c -> 'c) -> ('a, 'b) t -> 'c -> 'c
OCaml

Innovation. Community. Security.