package spotlib

  1. Overview
  2. Docs
type ('a, 'b) t
val create : int -> ('a, 'b) t
val add : ('a, 'b) t -> 'a -> 'b -> unit
val find : ('a, 'b) t -> ('a -> 'b -> bool) -> ('a * 'b) option

find t f: the first (k,v) pair f k v = true, if exists, is returned as Some (k,v). If none found, returns None

val remove : ('a, 'b) t -> ('a -> 'b -> bool) -> ('a * 'b) option

remove t f: the first (k,v) pair f k v = true, if exists, is removed from t and returns the Some (k,v). If none found, returns None.

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

removeq t k removes the binding of the pointer equal k from t and returns its value if exists. Otherwise it returns None.

val length : ('a, 'b) t -> int

return the number of full elements

OCaml

Innovation. Community. Security.