Open
Description
Example:
auto pingPong = [](int x) -> reactor<int, int> {
while(1) {
x = co_yield x;
}
};
int main() {
auto actor = pingPong(1);
auto value = 0;
while( actor.next(value) ) {
value = actor.value() + 1;
}
}
This can be later used to implement:
- Haskell like io-monads
- elm like effect systems
- event-loops
- parser combinators
Activity