|
|
|
|
|
by quinnirill
4018 days ago
|
|
With Trine this would be function process () {
return this
::filter(isOk)
::map(toOtherType)
::flatten();
}
and then later: groupsOfItems::map(process);
Granted, the `flatten` function is not in the Trine yet, somehow forgot that from the initial release. |
|
Thanks for the information.
One question, though: How do user functions interact in here? If you didn't include `flatten`, but I had my own version of it, would it be straightforward for me to build `process` using my own `flatten`? Do I have to modify some Trine objects, or can I use some simple function references?
Obviously I haven't yet actually dug into the Trine code. Perhaps this weekend.