📼 lazy, composable iterators for zig
- Zig 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| src | ||
| .gitignore | ||
| build.zig | ||
| build.zig.zon | ||
| license | ||
| readme.md | ||
📼 ziter
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.
Todo
- Unit tests.
- Filters and maps with context, as Zig lacks closures. :(
- Mayyybe remove
Itemand just requirenextasItemcan probably always be inferred fromnext? - Write actual documentation.