Function: -flatten

-flatten is a byte-compiled function defined in dash.el.

Signature

(-flatten L)

Documentation

Take a nested list L and return its contents as a single, flat list.

Note that because nil represents a list of zero elements (an empty list), any mention of nil in L will disappear after flattening. If you need to preserve nils, consider -flatten-n or map them to some unique symbol and then map them back.

Conses of two atoms are considered "terminals", that is, they aren't flattened further.

See also: -flatten-n

View in manual

Source Code

;; Defined in ~/.emacs.d/elpa/dash-20260221.1346/dash.el
(defun -flatten (l)
  "Take a nested list L and return its contents as a single, flat list.

Note that because nil represents a list of zero elements (an
empty list), any mention of nil in L will disappear after
flattening.  If you need to preserve nils, consider `-flatten-n'
or map them to some unique symbol and then map them back.

Conses of two atoms are considered \"terminals\", that is, they
aren't flattened further.

See also: `-flatten-n'"
  (declare (pure t) (side-effect-free t))
  (if (and (listp l) (listp (cdr l)))
      (-mapcat '-flatten l)
    (list l)))