4 ms·
So if Clojure had some form of fusion of composed functions on lists, that would equate out to what transducers are doing?
by ch 11y ago
So if Clojure had some form of fusion of composed functions on lists, that would equate out to what transducers are doing?
- fnordsensei 11y agoThat's almost literally what happens. (comp (map inc) (filter even?)) when applied takes all even numbers from a collection/channel/what-have-you and adds one to them. Filter and map normally take a collection as their last argument, but when none are supplied, a transducer is returned instead.