jon.recoil.org

Module Leapfrog.Join

Parameters

Signature

include Flambda2_algorithms.Leapfrog.Iterator
type 'a t

'a t is the type of iterators with keys of type 'a. The type of values is hidden.

val current : 'a t -> 'a option

current it is the key at the current position of the iterator it, or None if the iterator is exhausted.

val advance : 'a t -> unit

advance it advances the iterator to the next key.

advance is a no-op on an exhausted iterator.

val seek : 'a t -> 'a -> unit

seek it x moves the iterator to the least upper bound for x, i.e. the least key y such that y >= x, exhausting the iterator if no such key exists.

Note: Only keys greater than the current position are considered: seek does nothing if x is smaller than the current key.

val init : 'a t -> unit

init it resets it to the first key of a new iteration.

val accept : 'a t -> unit

accept it accepts the value associated with the current key, preparing the iterator at the next depth for iteration.

val equal_key : 'a t -> 'a -> 'a -> bool

equal_key it is an equality function iterator keys.

val compare_key : 'a t -> 'a -> 'a -> int

equal_key it is a comparison function on iterator keys.

val create : 'a Iterator.t list -> 'a t

create iterators returns a new imperative iterator that iterates over the join of the keys in iterators using the leapfrog join algorithm. The keys of the returned iterator are those that are present in all of the iterators in iterators.

The trie navigation operations init and accept are delegated to the underlying iterators.