Function: haskell-cabal-listify
haskell-cabal-listify is a natively compiled function defined in
haskell-cabal.el.
Signature
(haskell-cabal-listify COMMA-STYLE)
Documentation
Add commas so that the buffer contains a comma-separated list.
Respect the COMMA-STYLE, see
haskell-cabal-strip-list-and-detect-style for the possible
styles.
Source Code
;; Defined in /nix/store/9lz2mhw95f9fqxr9mnq46k3f6qz3aq83-emacs-packages-deps/share/emacs/site-lisp/elpa/haskell-mode-20260904.1042/haskell-cabal.el
(defun haskell-cabal-listify (comma-style)
"Add commas so that the buffer contains a comma-separated list.
Respect the COMMA-STYLE, see
`haskell-cabal-strip-list-and-detect-style' for the possible
styles."
(cl-case comma-style
(before
(goto-char (point-min))
(while (haskell-cabal-ignore-line-p) (forward-line))
(indent-to 2)
(forward-line)
(haskell-cabal-each-line
(unless (haskell-cabal-ignore-line-p)
(insert ", "))))
(after
(goto-char (point-max))
(while (equal 0 (forward-line -1))
(unless (haskell-cabal-ignore-line-p)
(end-of-line)
(insert ",")
(beginning-of-line))))
(single
(goto-char (point-min))
(while (not (eobp))
(end-of-line)
(unless (eobp)
(insert ", ")
(delete-char 1)
(just-one-space))))))