MacOS also employs memory compression, so it's not necessarily swapping to disk.
newPipeline(stream)
.then(map(::mapFn))
.then(filter(::filterFn))
.then(customTransform())
.collect(Collectors.toList());
Contrast that to Clojure, where everything's a function: (into []
(customTransform
(filter filterFn
(map mapFn collection))))
Or (using the threading macro, I think this is right) (->> collection
(map mapFn)
(filter filterFn)
(customTransform)
(into []))
Or (using transducers, I'm really not sure if this is right) (into []
(comp
(map mapFn)
(filter filterFn)
(customTransducer))
collection)
[1] https://github.com/clojure/clojure/blob/2b3ba822815981e7f769...