Skip to content

Latest commit

 

History

45 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Zig itertools

travis zig070

Port of the Python itertools library to Zig, introduces a functional programming library to the language.
Maintains efficiency by reducing temporary allocations, and moving through slices using an iterator. The library also includes some constructs such as map, filter and reduce which are part of the Python builtin library which are essential for functional programming.

And of course, their compile time counterparts!

Suggestions and contributions are welcome.

NOTE: De-initializing the iterator is the responsibility of the user.

Generic Iterator

Iterators

Min

Max

Reduce

Map

Filter

Accumulate

Dropwhile

Filterfalse

Compress

Takewhile

Combinatoric Iterators

Powerset

Permutations

Lexicographically ordered

Efficient: Heap's method

Combinations

Generate from permutations

Twiddle (Another Secret: A more efficient version, is in onebsv05, account locked out)

Product

Note: The library does not support generators yet

Sources

MITx: 6.00.2x

Sedgewick R, Permutation Generation Methods, Princeton University

ctregex by Alex Naskos

About

An improved version of the existing python itertools library that I created for Zig.

Topics

Resources

Stars

18 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages