Comments (6)
I see your point and we will discuss possible changes for the 1.2 release.
from libraries.
Sorry, that I just come now back to this.
So zip should be doing, what join is doing now? So it collects a set of n values from all upstream senders and passes it then to the process, that accepts n parameters? Or do you think, that this process should accept a tuple of n elements?
For the beginning, I would not implement a reduction/join.
So merge then will be parametrized. One option is 'round-robin', 'unordered' and 'zip' would then be the third one?
from libraries.
No need to apologize.
So, zip would strictly be:
zip(channel<T1>, channel<T2>, ...) -> channel<tuple<T1, T2, ...>>
but the option to also support n-ary processes could be cool - haven't checked how you implemented the library, but something like a constexpr-if on std::is_invocable<F, T1, T2, ...>
to choose whether to use std::apply
or std::invoke
(separate tuple args vs pass the tuple as the argument) could do the trick.
And join would be
join(channel<channel<T>>) -> channel<T>
from libraries.
Currently, a channel consists of two ends: a sender and a receiver. Each receiver is associated with a process (e.g. a callable object or an instance of a process that has to implement certain functions.)
I am not that deep in functional programming - I have your upcoming book already on my order list :-) - so would a zip implementation qualify your expectations when it would go like this:
template <typename F, typename... T>
zip(F&& f, receiver<T>, ...) -> receiver<result_of_t<F(T...)>>
where F is a callable object with T... parameters?
Or must F take as argument a tuple<T...>
?
from libraries.
Heh, I'm blushing :)
Usually, the zip
function generates a series of tuples, and the zip_with
calls an n-ary function. If you can not create one transformation that does both through static introspection, maybe zip
+ zip_with
will do the trick (it would make it compatible with range-v3).
from libraries.
Fixed in 1.3.0
from libraries.
Related Issues (20)
- Version in CMakeLists.txt is not correct
- Some files are missing in ./stlab/CMakeLists.txt HOT 1
- Build Error for Portable Executor for c++14 HOT 1
- Executor of packaged_task not used in reduction HOT 7
- Extra Copy of Object in Future Somewhere
- wasm main executor object not defined
- Upgrade to 1.7.1 now requires Qt and Boost HOT 20
- Is documentation generation broken? HOT 12
- No build output HOT 2
- Generated config.hpp Disables Ability to Use Same Source For Multiple Platforms HOT 1
- main_executor_type lost in main_executor.hpp for EMSCRIPTEN HOT 1
- Problem with main_executor for Qt on application exit HOT 3
- WASM main_executor improvements
- Broken compatibility with Qt5 HOT 1
- Handling more then one priority_task_system instance HOT 6
- stlab documentation, best practice and performance HOT 3
- Express the type of `promise` HOT 3
- windows default executor is not exception safe.
- Add weak_future<>
- Update range based algorithms
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libraries.