-
Notifications
You must be signed in to change notification settings - Fork 0
Backpack
This page describes the proposed modifications to Cabal and cabal-install in order to support Backpack, a new module system for Haskell.
It has a companion page on the GHC Trac: https://ghc.haskell.org/trac/ghc/wiki/Backpack
The bulk of the implementation of Backpack lives in GHC, which in principle allows us to write a specification for Backpack without any reference to Cabal. However, there are a few important points by which Backpack interacts with Cabal:
-
A Backpack file replaces a set of modules specified by
exposed-moduleswith a Backpack file; Cabal must be told where this Backpack file lives (abackpack-filefield) and must call GHC differently (--backpack) to actual compile it. -
A Backpack file can define multiple units, analogous to the way Cabal files can define multiple components (e.g. a library as well as a test suite library). Each of these units must have an a/so/dll library created for it and be registered individually in the installed unit database. Cabal is responsible for both of these operations.
-
A Backpack file can define an indefinite unit, which is a unit that cannot be compiled to code because it has some requirements that will be filled by a later client of the unit. The results of typechecking such a unit must be registered in the indefinite unit database (a Cabal operation), and cabal-install is responsible for recompiling the unit when a specific instantiation is required by an install plan.
The first point is a relatively minor change to Cabal; however the second and third points require some major architectural changes to Cabal's model.