Lazy, composable iterators for Zig.
Any container type may be an iterator as long as it declares the following:
pub const Item = T;
pub fn next(self: *@This()) ?Item;next must return null when the iterator is exhausted, and must not return
an error union.
Iterators may be created via slice, range, adapt, or from, from slices,
intervals, std-style iterators, or hand-written implementations respectively.
Check src/main.zig for more details until a proper documentation is written.
- Unit tests.
- Filters and maps with context, as Zig lacks closures. :(
- Mayyybe remove
Itemand just requirenextasItemcan probably always be inferred fromnext? - Write actual documentation.