Joaquin M Lopez Muñoz pointed out on a reddit thread:
In fact, the design pattern you propose would be closer to a continuation-like monad if the lib allowed for algorithm chaining with deferred execution:
auto v=move()|sort([](...){...})|...;
std::cout<<v({1,2,3});
which would enable interesting (or fun, at least) applications.
I think this is an interesting feature that deserves consideration. Despite the actual categories feel more natural for me (They operate on the input container directly), the deferred version operates much better on large data sets.
I propose a new group of algorithm categories snail::categories::lazy_XXXX implementing CPS.
It's possible to write a function to translate the current Container -> Container algorithms into it's CPS version directly?
Joaquin M Lopez Muñoz pointed out on a reddit thread:
I think this is an interesting feature that deserves consideration. Despite the actual categories feel more natural for me (They operate on the input container directly), the deferred version operates much better on large data sets.
I propose a new group of algorithm categories
snail::categories::lazy_XXXX
implementing CPS.It's possible to write a function to translate the current
Container -> Container
algorithms into it's CPS version directly?