Skip to content

An improved rewrite and port of the python itertools library to Zig. An improved version of the existing itertools library that I created for zig. This will cause your CPU to burn with a sufficiently large number of params. You have been warned.

License

Notifications You must be signed in to change notification settings

thebsv/zitertools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Zig itertools

travis zig070

This is an attempt to port the itertools library from python to zig, in order to introduce a functional paradigm 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

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 rewrite and port of the python itertools library to Zig. An improved version of the existing itertools library that I created for zig. This will cause your CPU to burn with a sufficiently large number of params. You have been warned.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages