package core_kernel

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

Module Hash_heap.MakeSource

Parameters

Signature

Sourcemodule Key = Key
Sourcetype 'a t
Sourceval create : ?min_size:int -> ('a -> 'a -> int) -> 'a t
Sourceval comparator : 'a t -> 'a -> 'a -> int
Sourceval copy : 'a t -> 'a t
Sourceval push : 'a t -> key:Key.t -> data:'a -> [ `Ok | `Key_already_present ]
Sourceval push_exn : 'a t -> key:Key.t -> data:'a -> unit
Sourceval replace : 'a t -> key:Key.t -> data:'a -> unit
Sourceval remove : 'a t -> Key.t -> unit
Sourceval mem : 'a t -> Key.t -> bool
Sourceval top : 'a t -> 'a option
Sourceval top_exn : 'a t -> 'a
Sourceval top_with_key : 'a t -> (Key.t * 'a) option
Sourceval top_with_key_exn : 'a t -> Key.t * 'a
Sourceval pop_with_key : 'a t -> (Key.t * 'a) option
Sourceval pop_with_key_exn : 'a t -> Key.t * 'a
Sourceval pop : 'a t -> 'a option
Sourceval pop_exn : 'a t -> 'a
Sourceval pop_if_with_key : 'a t -> (key:Key.t -> data:'a -> bool) -> (Key.t * 'a) option
Sourceval pop_if : 'a t -> ('a -> bool) -> 'a option
Sourceval find : 'a t -> Key.t -> 'a option
Sourceval find_pop : 'a t -> Key.t -> 'a option
Sourceval find_exn : 'a t -> Key.t -> 'a
Sourceval find_pop_exn : 'a t -> Key.t -> 'a
Sourceval iter_keys : _ t -> f:(Key.t -> unit) -> unit

Mutation of the heap during iteration is not supported, but there is no check to prevent it. The behavior of a heap that is mutated during iteration is undefined.

Sourceval iter : 'a t -> f:('a -> unit) -> unit
Sourceval iteri : 'a t -> f:(key:Key.t -> data:'a -> unit) -> unit
Sourceval to_alist : 'a t -> (Key.t * 'a) list

Returns the list of all (key, value) pairs for given Hash_heap.

Sourceval length : 'a t -> int
Sourceval is_empty : 'a t -> bool
Sourceval clear : 'a t -> unit

Removes all values, leaving the hash heap empty. *

OCaml

Innovation. Community. Security.