Skip to content
mellowcoffeePublic

About

📼 lazy, composable iterators for zig

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📼 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.

About

📼 lazy, composable iterators for zig

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages