Following up from GHC and Cabal: the big picture, I hypothesise that part of the problem described is due to poorly-specified APIs[1], particularly the command line API to GHC that enables “packages” (perhaps more precisely, “units” – the ambiguity is symptomatic of the poorly-specified API).
This got me thinking further. Here’s an idea:
A nice way of specifying command line APIs would be to take a subset of all possible command lines for a program, and call it the “core” command line API. It should be as small as possible. Every other valid command line should “desugar” into an instance of the core API. This idea was inspired by the way GHC desugars a very wide range of Haskell syntax into the small Core language. Any ambiguity about what Haskell syntax means can be resolved by inspecting its desugaring.
I was wondering if anyone had any thoughts about this idea of applying “desugar to core” to other APIs, such as command lines.
[1] I interpret “APIs” very broadly, and generally take it to mean “all programmer interfaces” rather than “application programmer interfaces”