Function: -tree-mapreduce
-tree-mapreduce is a byte-compiled function defined in dash.el.
Signature
(-tree-mapreduce FN FOLDER TREE)
Documentation
Apply FN to each element of TREE, and make a list of the results.
If elements of TREE are lists themselves, apply FN recursively to elements of these nested lists.
Then reduce the resulting lists using FOLDER and initial value
INIT-VALUE. See -reduce-r-from.
This is the same as calling -tree-reduce after -tree-map
but is twice as fast as it only traverse the structure once.
Source Code
;; Defined in ~/.emacs.d/elpa/dash-20260221.1346/dash.el
(defun -tree-mapreduce (fn folder tree)
"Apply FN to each element of TREE, and make a list of the results.
If elements of TREE are lists themselves, apply FN recursively to
elements of these nested lists.
Then reduce the resulting lists using FOLDER and initial value
INIT-VALUE. See `-reduce-r-from'.
This is the same as calling `-tree-reduce' after `-tree-map'
but is twice as fast as it only traverse the structure once."
(declare (important-return-value t))
(cond
((null tree) ())
((-cons-pair? tree) (funcall fn tree))
((consp tree)
(-reduce-r folder (mapcar (lambda (x) (-tree-mapreduce fn folder x)) tree)))
((funcall fn tree))))