devkit

Development kit - general purpose library
IN THIS PACKAGE
Module Devkit_core . Cache . Assoc
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,

  • raises Not_found

    if key is not present

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