ocaml-batteries-team/batteries-included — pull request #557 by gasche (2014-04-04 14:15:33+00:00)
Title: Balanced binary trees: enumeration starting from an arbitrary key

```ocaml
val enum_from : key -> 'a t -> (key * 'a) BatEnum.t
(** [enum_from k t] return an enumeration as [enum], but starting from
the first key equal or greater than [k] *)

val backwards_from : key -> 'a t -> (key * 'a) BatEnum.t
(** [backwards_from k t] return an enumeration as [backward], but
starting from the last key smaller or equal to [k] *)
```

Of course the performance of this are only as good than our enumeration library, but the code does not depend on it (Map and Set already had manually-derived control-inversed iterators that make these kind of things convenient) so it will be trivial to change to, say, `Sequence` if we want to in the future.