Conversation
|
I'm unsure about this one. While it could potentially be useful, it doesn't save a whole lot of typing, and the use-case doesn't seem that common: (mapcat-indexed f)
(comp (map-indexed f) cat)
(mapcat-indexed f coll)
(sequence (comp (map-indexed f) cat) coll)
(transduce (map-indexed f) into coll)And if |
|
Agreed it doesn't save a whole lot of typing, but I doubt I'm alone in often forgetting which order to put the functions in for I wouldn't be opposed to adding I won't make a strong argument on this one. I enjoy coding up these PRs, so it's no time wasted for me. Happy to leave it on the backburner or close entirely :) |
I feel this fits with medley pretty well. It exists in Kotlin as flatMapIndexed which I've used a few times recently, and realised is missing from clojure.core. It also exists in JS as the dyadic form of flatMap. It's useful for conditionally inserting extra items based on index, among other things. e.g.
lmk what you think :)