package lsp

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

Module Stdune.TableSource

Hashtable with a simple polymorphic type, but without the polymorphic equality.

This module re-wraps the hashtable implementation provided by Hashtbl.Make under a different interface: we just have a single type ('k, 'v) t, similar to a polymorphic hashtable.

This means that if you want a hash table generic over the type of keys, you don't have to put your type inside a functor.

Unlike the polymorphich hashtable (('k, 'v) Hashtbl.t), this does not use polymorphic hash and polymorphic equality, so this module does respect abstraction boundaries.

Sourcetype ('k, 'v) t
Sourcemodule type Key = sig ... end
Sourceval create : (module Key with type t = 'k) -> int -> ('k, 'v) t
Sourceval find : ('k, 'v) t -> 'k -> 'v option
Sourceval find_exn : ('k, 'v) t -> 'k -> 'v
Sourceval set : ('k, 'v) t -> 'k -> 'v -> unit
Sourceval add_exn : ('k, 'v) t -> 'k -> 'v -> unit
Sourceval add : ('k, 'v) t -> 'k -> 'v -> (unit, 'v) Result.t
Sourceval clear : ('k, 'v) t -> unit
Sourceval mem : ('k, _) t -> 'k -> bool
Sourceval keys : ('k, _) t -> 'k list
Sourceval foldi : ('k, 'v) t -> init:'init -> f:('k -> 'v -> 'init -> 'init) -> 'init
Sourceval fold : (_, 'v) t -> init:'init -> f:('v -> 'init -> 'init) -> 'init
Sourceval to_dyn : ('v -> Dyn.t) -> (_, 'v) t -> Dyn.t
Sourceval find_or_add : ('k, 'v) t -> 'k -> f:('k -> 'v) -> 'v
Sourceval remove : ('k, _) t -> 'k -> unit
Sourceval iter : (_, 'v) t -> f:('v -> unit) -> unit
Sourceval filteri_inplace : ('a, 'b) t -> f:(key:'a -> data:'b -> bool) -> unit
Sourceval length : (_, _) t -> int
Sourcemodule Multi : sig ... end
OCaml

Innovation. Community. Security.