TLDR: Python / C#
yield with performance matching plain Julia iterators (i.e. unbelievably fast)
Continuables are generator-like higher-order functions which take a continuation as an extra argument. The key macro provided by the package is
@cont which will give access to the special function
cont within its scope and wraps the computation in a special Type
It is best to think of
cont in the sense of
yield from Python's Generators. It generates values and takes feedback from the outer process as return value.
If you come from Python, use Continuables wherever you would use generators. If you are Julia-native, Continuables can be used instead of Julia's Channels in many place with drastic performance-improvements (really drastic: in the little benchmark example below it is 20 million times faster!).
This package implements all standard functions like e.g.
any and others. As well as functionalities known from
nth and others.
For convenience, all methods also work for plain iterables.
using Pkg pkg"add Continuables"
Use it like
For further information take a look at the documentation.