Function: haskell-cabal-add-build-dependency

haskell-cabal-add-build-dependency is a natively compiled function defined in haskell-cabal.el.

Signature

(haskell-cabal-add-build-dependency DEPENDENCY &optional SORT SILENT)

Documentation

Add the given DEPENDENCY to every section in cabal file.

If SORT argument is given sort dependencies in section after update. Pass SILENT argument to update all sections without asking user.

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-add-build-dependency (dependency &optional sort silent)
  "Add the given DEPENDENCY to every section in cabal file.
If SORT argument is given sort dependencies in section after update.
Pass SILENT argument to update all sections without asking user."
  (haskell-cabal-map-sections
   (lambda (section)
     (when (haskell-cabal-source-section-p section)
       (unwind-protect
           (progn
             (when
                 (or silent
                     (y-or-n-p (format "Add dependency %s to %s section %s?"
                                       dependency
                                       (haskell-cabal-section-name section)
                                       (haskell-cabal-section-value section))))
               (haskell-cabal-section-add-build-dependency dependency
                                                           sort
                                                           section))
             nil)
         (haskell-mode-toggle-interactive-prompt-state t))))))