Timeline for Function that does for Map what Through does for Apply?
Current License: CC BY-SA 4.0
7 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Dec 17, 2021 at 5:45 | comment | added | theorist | @J.M. I found all the answers here great—and instructive. But I have to say yours was my favorite, because it accomplishes the task with the simplest possible syntax: Going from "multiApply" to "multiMap" just requires changing from Through[{func1, func2, func3...}[s2]] to Through@*{func1, func2, func3...}/@s2. And it cleverly accomplishes this by composing func 1, func2,.. with Throughto create a new composite function, and then mapping that composite function to the arguments. Since you donated your syntax to kglr's answer, I'll give it the credit :). | |
| Dec 17, 2021 at 4:37 | vote | accept | theorist | ||
| Dec 14, 2021 at 23:00 | history | edited | kglr | CC BY-SA 4.0 | added 145 characters in body |
| Dec 14, 2021 at 17:32 | comment | added | J. M.'s missing motivation | @Carl, this is effectively equivalent to kglr's approach (with the advantage you mention of being slot-free), so I would prefer that kglr edit his answer to include it. | |
| Dec 14, 2021 at 17:27 | comment | added | Carl Woll | @J.M. I think you should post this as an answer, I really like operator forms that avoid using slots. | |
| Dec 14, 2021 at 14:20 | comment | added | J. M.'s missing motivation | I use the following variation myself rather frequently: Through @* {StringJoin, Length} /@ {{"h", "e", "l", "l", "o"}, {"d", "a", "y"}} | |
| Dec 14, 2021 at 11:22 | history | answered | kglr | CC BY-SA 4.0 |