Function: haskell-cabal-section-add-build-dependency
haskell-cabal-section-add-build-dependency is a natively compiled
function defined in haskell-cabal.el.
Signature
(haskell-cabal-section-add-build-dependency DEPENDENCY &optional SORT SEC)
Documentation
Add a build dependency to the build-depends section
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-section-add-build-dependency (dependency &optional sort sec)
"Add a build dependency to the build-depends section"
(let* ((section (or sec (haskell-cabal-section)))
(subsection (and section
(haskell-cabal-find-subsection section "build-depends"))))
(when subsection
(haskell-cabal-with-subsection
subsection t
(haskell-cabal-with-cs-list
(insert dependency)
(insert "\n")
(when sort
(goto-char (point-min))
(sort-subr nil 'forward-line 'end-of-line
'haskell-cabal-sort-lines-key-fun)))))))