The relationship of GHC and Cabal

Yesterday, while chatting with Simon Peyton Jones, I got a better picture of Simon’s mental model of how GHC and Cabal (the library) fit together. Essentially, Simon has an imaginary firewall between GHC and Cabal, where if there is any package-related complexity that the core GHC doesn’t need to know about, it can be pushed into Cabal. GHC has a low-level interface that can be implemented simply, and Cabal is responsible for “pushing the buttons” on this interface so that GHC does the right thing.

Thus, one road to understanding how Cabal works (and perhaps, why it’s failing to build some package of yours) is to understand what knobs it has available from GHC.