Module Incr_map.Lookup

('k, 'v) Lookup.t provides a way to lookup keys in a map which uses symmetric diffs to trigger updates of the lookups.

The complexity of an update depends on:

Each update should cost O(symdiff(n) + m * log k), so this will be efficient when there are a lot of lookups (close to n) into a map which can be efficiently symdiffed (and therefore has a small number of changes also). The cost of updating when performing the same lookups by means of Incr.map ~f:(fun m -> Map.find m key) is O(k * log n).

type ('k, 'v, 'cmp, 'w) t
val create : ?⁠data_equal:('v -> 'v -> bool) -> (('k'v'cmp) Core_kernel.Map.t'w) Incremental.t -> comparator:('k'cmp) Core_kernel.Comparator.t -> ('k'v'cmp'w) t

Create the lookup structure on an incremental map.

val find : ('k'v_'w) t -> 'k -> ('v option'w) Incremental.t

Create a node which performs Map.find on the input map.

find (create incr_map) key should be equivalent to Incr.map ~f:(fun m -> Map.find m key) incr_map, but when you call find many times for a single create the nodes should update more efficiently in stabilisation when incr_map changes in a way which can be efficiently diffed.

This will re-use existing nodes when it can, but will not always do so.

module M : functor (K : sig ... end) -> sig ... end

A convenient way to refer to the type for a given key.

module For_debug : sig ... end