Watch
1
0
Fork
You've already forked ziter
0
📼 lazy, composable iterators for zig
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-08-28 01:11:52 +02:00
src init 2026-08-28 01:10:38 +02:00
.gitignore init 2026-08-28 01:10:38 +02:00
build.zig init 2026-08-28 01:10:38 +02:00
build.zig.zon init 2026-08-28 01:10:38 +02:00
license init 2026-08-28 01:10:38 +02:00
readme.md docs: fixed readme 2026-08-28 01:11:52 +02:00

📼 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 Item and just require next as Item can probably always be inferred from next?
  • Write actual documentation.