Cabal-add: extend Cabal build-depends from the command line

As promised, I had a go at breaking this, since I got some time today. I managed to very nearly do it with a common stanza… but it appears that Cabal is fine with having two build-depends clauses in a target, so that doesn’t actually break anything. Very impressive work! (It even detects whether I’ve used leading or trailing commas, which is really nice.)

That being said, I dislike the restriction that it can only add packages at the beginning of the build-depends. Personally, I strongly prefer a style where the first line is reserved for base, and this tool messes it up. It would be nicer to, for instance, insert the new package in alphabetical order, or something similar.

2 Likes