Module Loko.Iterator

Imperative iterator.

exception Done

Raised by next without backtrace after all the elements have been returned.

type ('xs, 'x) t =
  1. | T : {
    1. start : 'xs -> 'iterator;
    2. next : 'iterator -> 'x;
    } -> ('xs, 'x) t

An iterator extracts elements of type 'x one-by-one from a collection of type 'xs.