Function: -reduce-from

-reduce-from is a byte-compiled function defined in dash.el.

Signature

(-reduce-from FN INIT LIST)

Documentation

Reduce the function FN across LIST, starting with INIT.

Return the result of applying FN to INIT and the first element of LIST, then applying FN to that result and the second element, etc. If LIST is empty, return INIT without calling FN.

This function's anaphoric counterpart is --reduce-from.

For other folds, see also -reduce and -reduce-r.

View in manual

Source Code

;; Defined in ~/.emacs.d/elpa/dash-20260221.1346/dash.el
(defun -reduce-from (fn init list)
  "Reduce the function FN across LIST, starting with INIT.
Return the result of applying FN to INIT and the first element of
LIST, then applying FN to that result and the second element,
etc.  If LIST is empty, return INIT without calling FN.

This function's anaphoric counterpart is `--reduce-from'.

For other folds, see also `-reduce' and `-reduce-r'."
  (declare (important-return-value t))
  (--reduce-from (funcall fn acc it) init list))