Function: -tree-map

-tree-map is a byte-compiled function defined in dash.el.

Signature

(-tree-map FN TREE)

Documentation

Apply FN to each element of TREE while preserving the tree structure.

View in manual

Source Code

;; Defined in ~/.emacs.d/elpa/dash-20260221.1346/dash.el
(defun -tree-map (fn tree)
  "Apply FN to each element of TREE while preserving the tree structure."
  (declare (important-return-value t))
  (cond
   ((null tree) ())
   ((-cons-pair? tree) (funcall fn tree))
   ((consp tree)
    (mapcar (lambda (x) (-tree-map fn x)) tree))
   ((funcall fn tree))))