|
|
[ Backpack](http://plv.mpi-sws.org/backpack/) is a proposal for retrofitting Haskell with an applicative, mix-in module system. The theory of Backpack is developed in the paper and its accompanying technical appendix. The purpose of this page is to track implementation progress. (Wondering what happened to the old text? Check the history; it will be integrated into the implementation design doc eventually).
|
|
|
|
|
|
## Reading
|
|
|
|
|
|
See also [CabalDependency](cabal-dependency)
|
|
|
|
|
|
## Reading
|
|
|
|
|
|
- [ Design document](https://git.haskell.org/ghc.git/blob/HEAD:/docs/backpack/backpack-impl.pdf): quite technical, but a lot of good information about how the system we are implementing differs from the Backpack paper
|
|
|
- [ Manual](https://git.haskell.org/ghc.git/blob/HEAD:/docs/backpack/backpack-manual.pdf): user facing specification of the system
|
|
|
- [ What's a module system good for anyway?](http://blog.ezyang.com/2014/08/whats-a-module-system-good-for-anyway/) Motivates \*why\* you might care about Backpack
|
|
|
- [ A taste of Cabalized Backpack](http://blog.ezyang.com/2014/08/a-taste-of-cabalized-backpack/): Tutorial style introduction to the Cabal-style syntax for writing Backpack modules
|
|
|
- The [commentary pages about packages](commentary/compiler/packages)
|
|
|
- Planned: blog post about thinning/renaming
|
|
|
|
|
|
## Implementing "A taste of Cabalized Backpack"
|
|
|
|
|
|
|
|
|
Many of the features described in [ A taste of Cabalized Backpack](http://blog.ezyang.com/2014/08/a-taste-of-cabalized-backpack/) are not implemented yet. Here's the blow-by-blow:
|
|
|
|
|
|
- GHC signature support is in progress at [ D130](https://phabricator.haskell.org/D130)
|
|
|
|
|
|
- exposed-signatures in GhcPackage behaves the same as required-signatures (GHC needs to consider these modules exposed for the purpose of module lookup)
|
|
|
- We don't support multiple backing implementations for a signature, as SPJ mentions in Phab. The good thing about this is if we implement this we will automatically get signature merging. One difficulty: making sure all of the definitions of the signature have been satisfied! Also need to adjust package key format.
|
|
|
- Cabal signature support is in progress at [ ezyang/cabal:ezyang-dev](https://github.com/ezyang/cabal/tree/ezyang-dev)
|
|
|
|
|
|
- We don't support the "semicolon" syntax, which allows you to include a package multiple times (usually used to instantiate it differently.) Monoid plus should be replaced with semicolon operation.
|
|
|
- If anyone wants it: hiding and bulk rename for thinning/renaming
|
|
|
- Figure out if you can rename types, and if not, what to do
|
|
|
- implements field is not implemented
|
|
|
- reexported-modules may not work with signatures (untested)
|
|
|
- Support type families in signatures
|
|
|
- Carefully test our hole map algorithm to make sure we're actually canonicalizing things enough (we probably aren't...)
|
|
|
- Typechecking against signatures (the next frontier)
|
|
|
- Installing indefinite packages (reusing the installed package database as a place to stash source packages...)
|
|
|
|
|
|
## Backpack-related tickets
|
|
|
|
|
|
|
|
|
Backpack-related tickets are marked with keyword 'backpack'. If the ticket is assigned to ezyang, it means he's planning on working on it.
|
|
|
|
|
|
## Status: closed (41 matches)
|
|
|
|
|
|
<table><tr><th>Ticket (Ticket query: keywords: backpack, group: status, max: 0, col: id, col: type, col: summary, col: priority, col: owner, order: id)</th>
|
|
|
<th>Type (Ticket query: keywords: backpack, group: status, max: 0, col: id, col: type, col: summary, col: priority, col: owner, order: type)</th>
|
|
|
<th>Summary (Ticket query: keywords: backpack, group: status, max: 0, col: id, col: type, col: summary, col: priority, col: owner, order: summary)</th>
|
|
|
<th>Priority (Ticket query: keywords: backpack, group: status, max: 0, col: id, col: type, col: summary, col: priority, col: owner, desc: 1, order: priority)</th>
|
|
|
<th>Owner (Ticket query: keywords: backpack, group: status, max: 0, col: id, col: type, col: summary, col: priority, col: owner, order: owner)</th></tr>
|
|
|
<tr><th>[\#8407](https://gitlab.haskell.org//ghc/ghc/issues/8407)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
feature request
|
|
|
</th>
|
|
|
<th>[Module re-exports at the package level](https://gitlab.haskell.org//ghc/ghc/issues/8407)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
high
|
|
|
</th>
|
|
|
<th>ezyang</th></tr>
|
|
|
<tr><th>[\#9243](https://gitlab.haskell.org//ghc/ghc/issues/9243)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bug
|
|
|
</th>
|
|
|
<th>[Recompilation avoidance doesn't work for -fno-code/-fwrite-interface](https://gitlab.haskell.org//ghc/ghc/issues/9243)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
high
|
|
|
</th>
|
|
|
<th>ezyang</th></tr>
|
|
|
<tr><th>[\#9265](https://gitlab.haskell.org//ghc/ghc/issues/9265)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
feature request
|
|
|
</th>
|
|
|
<th>[Create PackageKey to replace PackageId, including version dependency information](https://gitlab.haskell.org//ghc/ghc/issues/9265)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
high
|
|
|
</th>
|
|
|
<th>ezyang</th></tr>
|
|
|
<tr><th>[\#12945](https://gitlab.haskell.org//ghc/ghc/issues/12945)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bug
|
|
|
</th>
|
|
|
<th>[Backpack signature matching doesn't pick up orphan instances](https://gitlab.haskell.org//ghc/ghc/issues/12945)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
high
|
|
|
</th>
|
|
|
<th>ezyang</th></tr>
|
|
|
<tr><th>[\#9245](https://gitlab.haskell.org//ghc/ghc/issues/9245)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bug
|
|
|
</th>
|
|
|
<th>[In absence of recursive imports, hs-boot files not checked for consistency](https://gitlab.haskell.org//ghc/ghc/issues/9245)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
normal
|
|
|
</th>
|
|
|
<th>ezyang</th></tr>
|
|
|
<tr><th>[\#9252](https://gitlab.haskell.org//ghc/ghc/issues/9252)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
feature request
|
|
|
</th>
|
|
|
<th>[Generalize hs-boot files to be more like module signatures](https://gitlab.haskell.org//ghc/ghc/issues/9252)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
normal
|
|
|
</th>
|
|
|
<th></th></tr>
|
|
|
<tr><th>[\#9256](https://gitlab.haskell.org//ghc/ghc/issues/9256)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
feature request
|
|
|
</th>
|
|
|
<th>[Support automatic derivation of an hs-boot file from an hs file](https://gitlab.haskell.org//ghc/ghc/issues/9256)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
normal
|
|
|
</th>
|
|
|
<th>ezyang</th></tr>
|
|
|
<tr><th>[\#9375](https://gitlab.haskell.org//ghc/ghc/issues/9375)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
feature request
|
|
|
</th>
|
|
|
<th>[Support for module thinning/renaming on command line](https://gitlab.haskell.org//ghc/ghc/issues/9375)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
normal
|
|
|
</th>
|
|
|
<th>ezyang</th></tr>
|
|
|
<tr><th>[\#9506](https://gitlab.haskell.org//ghc/ghc/issues/9506)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
task
|
|
|
</th>
|
|
|
<th>[Name libraries (dll/so) separately from linker symbols](https://gitlab.haskell.org//ghc/ghc/issues/9506)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
normal
|
|
|
</th>
|
|
|
<th>ezyang</th></tr>
|
|
|
<tr><th>[\#9507](https://gitlab.haskell.org//ghc/ghc/issues/9507)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
feature request
|
|
|
</th>
|
|
|
<th>[ghc-pkg mode to query by package-key](https://gitlab.haskell.org//ghc/ghc/issues/9507)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
normal
|
|
|
</th>
|
|
|
<th>ezyang</th></tr>
|
|
|
<tr><th>[\#9508](https://gitlab.haskell.org//ghc/ghc/issues/9508)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
task
|
|
|
</th>
|
|
|
<th>[Rename package key](https://gitlab.haskell.org//ghc/ghc/issues/9508)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
normal
|
|
|
</th>
|
|
|
<th>ezyang</th></tr>
|
|
|
<tr><th>[\#10252](https://gitlab.haskell.org//ghc/ghc/issues/10252)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
feature request
|
|
|
</th>
|
|
|
<th>[Abstract newtype in hs-boot](https://gitlab.haskell.org//ghc/ghc/issues/10252)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
normal
|
|
|
</th>
|
|
|
<th></th></tr>
|
|
|
<tr><th>[\#10262](https://gitlab.haskell.org//ghc/ghc/issues/10262)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bug
|
|
|
</th>
|
|
|
<th>[Improve documentation of module signatures](https://gitlab.haskell.org//ghc/ghc/issues/10262)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
normal
|
|
|
</th>
|
|
|
<th>ezyang</th></tr>
|
|
|
<tr><th>[\#10622](https://gitlab.haskell.org//ghc/ghc/issues/10622)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
task
|
|
|
</th>
|
|
|
<th>[Rename Backpack packages to units](https://gitlab.haskell.org//ghc/ghc/issues/10622)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
normal
|
|
|
</th>
|
|
|
<th>ezyang</th></tr>
|
|
|
<tr><th>[\#10660](https://gitlab.haskell.org//ghc/ghc/issues/10660)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bug
|
|
|
</th>
|
|
|
<th>[.dyn_o isn't generated for .hsig files with -dynamic-too](https://gitlab.haskell.org//ghc/ghc/issues/10660)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
normal
|
|
|
</th>
|
|
|
<th>spinda</th></tr>
|
|
|
<tr><th>[\#10690](https://gitlab.haskell.org//ghc/ghc/issues/10690)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bug
|
|
|
</th>
|
|
|
<th>[Save merged signatures to disk](https://gitlab.haskell.org//ghc/ghc/issues/10690)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
normal
|
|
|
</th>
|
|
|
<th></th></tr>
|
|
|
<tr><th>[\#10714](https://gitlab.haskell.org//ghc/ghc/issues/10714)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bug
|
|
|
</th>
|
|
|
<th>[After implementing new installed package ID (hash of sdist), get rid of package keys](https://gitlab.haskell.org//ghc/ghc/issues/10714)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
normal
|
|
|
</th>
|
|
|
<th>ezyang</th></tr>
|
|
|
<tr><th>[\#10725](https://gitlab.haskell.org//ghc/ghc/issues/10725)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
task
|
|
|
</th>
|
|
|
<th>[Figure out how to support type synonym implementions of abstract data](https://gitlab.haskell.org//ghc/ghc/issues/10725)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
normal
|
|
|
</th>
|
|
|
<th>ezyang</th></tr>
|
|
|
<tr><th>[\#10798](https://gitlab.haskell.org//ghc/ghc/issues/10798)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
feature request
|
|
|
</th>
|
|
|
<th>[Signatures with only types should not be included in unit keys](https://gitlab.haskell.org//ghc/ghc/issues/10798)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
normal
|
|
|
</th>
|
|
|
<th>ezyang</th></tr>
|
|
|
<tr><th>[\#10838](https://gitlab.haskell.org//ghc/ghc/issues/10838)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bug
|
|
|
</th>
|
|
|
<th>[hsig files don't have good enough error checking for wired-in types](https://gitlab.haskell.org//ghc/ghc/issues/10838)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
normal
|
|
|
</th>
|
|
|
<th>ezyang</th></tr>
|
|
|
<tr><th>[\#12699](https://gitlab.haskell.org//ghc/ghc/issues/12699)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bug
|
|
|
</th>
|
|
|
<th>[Suspicious treatment of renaming of field labels](https://gitlab.haskell.org//ghc/ghc/issues/12699)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
normal
|
|
|
</th>
|
|
|
<th>ezyang</th></tr>
|
|
|
<tr><th>[\#12955](https://gitlab.haskell.org//ghc/ghc/issues/12955)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bug
|
|
|
</th>
|
|
|
<th>[Confusing error (module is not loaded) when more hsigs provided than -instantiated-with](https://gitlab.haskell.org//ghc/ghc/issues/12955)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
normal
|
|
|
</th>
|
|
|
<th>ezyang</th></tr>
|
|
|
<tr><th>[\#12994](https://gitlab.haskell.org//ghc/ghc/issues/12994)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
feature request
|
|
|
</th>
|
|
|
<th>[Module and export level signature thinning in Backpack](https://gitlab.haskell.org//ghc/ghc/issues/12994)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
normal
|
|
|
</th>
|
|
|
<th></th></tr>
|
|
|
<tr><th>[\#13041](https://gitlab.haskell.org//ghc/ghc/issues/13041)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bug
|
|
|
</th>
|
|
|
<th>[Type classes in Backpack signatures are dodgy](https://gitlab.haskell.org//ghc/ghc/issues/13041)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
normal
|
|
|
</th>
|
|
|
<th>ezyang</th></tr>
|
|
|
<tr><th>[\#13066](https://gitlab.haskell.org//ghc/ghc/issues/13066)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bug
|
|
|
</th>
|
|
|
<th>[Backpack doesn't check for fixity consistency](https://gitlab.haskell.org//ghc/ghc/issues/13066)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
normal
|
|
|
</th>
|
|
|
<th>ezyang</th></tr>
|
|
|
<tr><th>[\#13067](https://gitlab.haskell.org//ghc/ghc/issues/13067)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bug
|
|
|
</th>
|
|
|
<th>[Abstract closed type families don't work with Backpack](https://gitlab.haskell.org//ghc/ghc/issues/13067)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
normal
|
|
|
</th>
|
|
|
<th>ezyang</th></tr>
|
|
|
<tr><th>[\#13214](https://gitlab.haskell.org//ghc/ghc/issues/13214)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bug
|
|
|
</th>
|
|
|
<th>[Orphan instances in Backpack signatures don't work](https://gitlab.haskell.org//ghc/ghc/issues/13214)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
normal
|
|
|
</th>
|
|
|
<th>ezyang</th></tr>
|
|
|
<tr><th>[\#13250](https://gitlab.haskell.org//ghc/ghc/issues/13250)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bug
|
|
|
</th>
|
|
|
<th>[Backpack: matching newtype selectors doesn't work](https://gitlab.haskell.org//ghc/ghc/issues/13250)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
normal
|
|
|
</th>
|
|
|
<th>ezyang</th></tr>
|
|
|
<tr><th>[\#13268](https://gitlab.haskell.org//ghc/ghc/issues/13268)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bug
|
|
|
</th>
|
|
|
<th>[Backpack doesn't work with Template Haskell, even when it should](https://gitlab.haskell.org//ghc/ghc/issues/13268)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
normal
|
|
|
</th>
|
|
|
<th></th></tr>
|
|
|
<tr><th>[\#13323](https://gitlab.haskell.org//ghc/ghc/issues/13323)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bug
|
|
|
</th>
|
|
|
<th>[Backpack doesn't work with DuplicateRecordFields](https://gitlab.haskell.org//ghc/ghc/issues/13323)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
normal
|
|
|
</th>
|
|
|
<th></th></tr>
|
|
|
<tr><th>[\#13335](https://gitlab.haskell.org//ghc/ghc/issues/13335)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bug
|
|
|
</th>
|
|
|
<th>[Non-abstract types also have skolem nature](https://gitlab.haskell.org//ghc/ghc/issues/13335)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
normal
|
|
|
</th>
|
|
|
<th></th></tr>
|
|
|
<tr><th>[\#14304](https://gitlab.haskell.org//ghc/ghc/issues/14304)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bug
|
|
|
</th>
|
|
|
<th>[Instantiated libraries (Backpack) don't get linked with enough deps](https://gitlab.haskell.org//ghc/ghc/issues/14304)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
normal
|
|
|
</th>
|
|
|
<th></th></tr>
|
|
|
<tr><th>[\#14525](https://gitlab.haskell.org//ghc/ghc/issues/14525)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bug
|
|
|
</th>
|
|
|
<th>[Backpack doesn't work with CPP](https://gitlab.haskell.org//ghc/ghc/issues/14525)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
normal
|
|
|
</th>
|
|
|
<th></th></tr>
|
|
|
<tr><th>[\#14674](https://gitlab.haskell.org//ghc/ghc/issues/14674)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
feature request
|
|
|
</th>
|
|
|
<th>[Deferring more levity polymorphism checks in indefinite backpack modules](https://gitlab.haskell.org//ghc/ghc/issues/14674)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
normal
|
|
|
</th>
|
|
|
<th></th></tr>
|
|
|
<tr><th>[\#15041](https://gitlab.haskell.org//ghc/ghc/issues/15041)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bug
|
|
|
</th>
|
|
|
<th>[rnIfaceBndr implementation in RnModIface looks incorrect](https://gitlab.haskell.org//ghc/ghc/issues/15041)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
normal
|
|
|
</th>
|
|
|
<th></th></tr>
|
|
|
<tr><th>[\#15138](https://gitlab.haskell.org//ghc/ghc/issues/15138)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bug
|
|
|
</th>
|
|
|
<th>[Unable to instantiate data members of kind Nat in backpack signatures.](https://gitlab.haskell.org//ghc/ghc/issues/15138)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
normal
|
|
|
</th>
|
|
|
<th></th></tr>
|
|
|
<tr><th>[\#15379](https://gitlab.haskell.org//ghc/ghc/issues/15379)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bug
|
|
|
</th>
|
|
|
<th>[Don't reject user-written instances of KnownNat and friends in hsig files](https://gitlab.haskell.org//ghc/ghc/issues/15379)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
normal
|
|
|
</th>
|
|
|
<th></th></tr>
|
|
|
<tr><th>[\#12679](https://gitlab.haskell.org//ghc/ghc/issues/12679)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
feature request
|
|
|
</th>
|
|
|
<th>[Permit abstract data types in signatures that don't have kind \*](https://gitlab.haskell.org//ghc/ghc/issues/12679)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
low
|
|
|
</th>
|
|
|
<th></th></tr>
|
|
|
<tr><th>[\#13068](https://gitlab.haskell.org//ghc/ghc/issues/13068)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bug
|
|
|
</th>
|
|
|
<th>[GHC should not allow modules to define instances of abstract type classes](https://gitlab.haskell.org//ghc/ghc/issues/13068)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
low
|
|
|
</th>
|
|
|
<th></th></tr>
|
|
|
<tr><th>[\#10723](https://gitlab.haskell.org//ghc/ghc/issues/10723)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
feature request
|
|
|
</th>
|
|
|
<th>[Make declarations in signatures "weakly bound" until they are used](https://gitlab.haskell.org//ghc/ghc/issues/10723)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lowest
|
|
|
</th>
|
|
|
<th>ezyang</th></tr>
|
|
|
<tr><th>[\#12701](https://gitlab.haskell.org//ghc/ghc/issues/12701)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
feature request
|
|
|
</th>
|
|
|
<th>[Eta reduce type synonyms when possible](https://gitlab.haskell.org//ghc/ghc/issues/12701)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lowest
|
|
|
</th>
|
|
|
<th></th></tr>
|
|
|
<tr><th>## Status: new (23 matches)
|
|
|
|
|
|
</th>
|
|
|
<th></th>
|
|
|
<th></th>
|
|
|
<th></th>
|
|
|
<th></th></tr>
|
|
|
<tr><th>Ticket (Ticket query: keywords: backpack, group: status, max: 0, col: id, col: type, col: summary, col: priority, col: owner, order: id)</th>
|
|
|
<th>Type (Ticket query: keywords: backpack, group: status, max: 0, col: id, col: type, col: summary, col: priority, col: owner, order: type)</th>
|
|
|
<th>Summary (Ticket query: keywords: backpack, group: status, max: 0, col: id, col: type, col: summary, col: priority, col: owner, order: summary)</th>
|
|
|
<th>Priority (Ticket query: keywords: backpack, group: status, max: 0, col: id, col: type, col: summary, col: priority, col: owner, desc: 1, order: priority)</th>
|
|
|
<th>Owner (Ticket query: keywords: backpack, group: status, max: 0, col: id, col: type, col: summary, col: priority, col: owner, order: owner)</th></tr>
|
|
|
- [ The Backpack documentation directory](https://git.haskell.org/ghc.git/blob/HEAD:/docs/backpack/). You'll have to build them (just `make`), but here are the files of interest:
|
|
|
|
|
|
- algorithm.tex specifies the abstract core Backpack algorithms for GHC.
|
|
|
- backpack-manual.tex is a user-facing manual for using Backpack.
|
|
|
- backpack-impl.tex is an old but interesting technical document describing many of the technical tradeoffs in our design.
|
|
|
- [ What's a module system good for anyway?](http://blog.ezyang.com/2014/08/whats-a-module-system-good-for-anyway/) Motivates \*why\* you might care about Backpack
|
|
|
- The [commentary pages about packages](commentary/compiler/packages),
|
|
|
|
|
|
|
|
|
see also [CabalDependency](cabal-dependency)
|
|
|
|
|
|
## Implementation notes
|
|
|
|
|
|
|
|
|
Backpack is a largely orthogonal extension to GHC; for example, there are no changes to the core type-checking or type-inference algorithm. Rather, the implementation of Backpack consists of:
|
|
|
|
|
|
1. A new language for describing "units" (called packages in the original Backpack paper). This language is written in `bkp` files, and looks like this:
|
|
|
|
|
|
```wiki
|
|
|
unit p where
|
|
|
include q (Q) requires (H)
|
|
|
module A
|
|
|
module B
|
|
|
```
|
|
|
|
|
|
1. A new frontend, `ghc --backpack` for processing `bkp` files, which can make (multiple) calls to `ghc --make` in order to typecheck and compile modules in a `bkp` file.
|
|
|
|
|
|
1. Infrastructure for handling \*indefinite units\*, i.e. units for which we have signatures but not implementations for some modules. This includes machinery to do \*shaping\*.
|
|
|
|
|
|
|
|
|
The most up-to-date description for the frontend and shaping can be found in `docs/backpack/algorithm.tex`, but here are some miscellaneous GHC-specific notes.
|
|
|
|
|
|
### Lazy interface loading
|
|
|
|
|
|
|
|
|
In paper Backpack, unification and substitution is performed eagerly on the type environment as soon as we discover that some type equality holds (e.g. during shaping). In GHC, the type environment is \*lazily\* loaded, and thus this substitution must be deferred until we actually load this interface. This has two consequences for GHC's interface loading code:
|
|
|
|
|
|
1. We may want the types for a module `p(A -> HOLE:B):M`, but we only have an interface file for `p(A -> HOLE:A):M`. In this case, we have to rename the interface file from `A -> HOLE:A` to `A -> HOLE:B` before we typecheck and load it in. This is handled by `computeInterface`, which calls `rnModIface` to apply the substitution.
|
|
|
|
|
|
1. Inside an interface file, we may refer to a Name `hole:A.T`. During shaping, we may have discovered that this Name actually is unified with `impl:A.T`; so when we are typechecking the interface file, we must use the real name and not stodgily adhere to the old one. The `eps_shape` data structure records these unifications, and a few data types (interface file renaming, interface type-checking, and even type-checking a signature) abide by this substitution.
|
|
|
|
|
|
### Semantic versus identity modules
|
|
|
|
|
|
|
|
|
Traditionally, the module identity of an `hs` or `hs-boot` file which is being type-checked is always `thisPackage` plus the module name; this is unique to the module. With signatures, this is not the case: `H.hsig` file might be traditionally called `p(H -> hole:H):H`, but in fact its declarations should be treated as if they were defined by a module `hole:H`. We say that `p(H -> hole:H):H` is the \*identity\* module which uniquely identifies the interface, whereas `hole:H` is the \*semantic\* module which identifies what the signature actually is implementing.
|
|
|
|
|
|
### Signature merging
|
|
|
|
|
|
|
|
|
Unlike regular modules, you cannot simply \*hide\* a hole: it is a requirement that always must be fulfilled before you can compile the module in question. Instead, if you define an `A.hsig` for an `A` which is already required by another unit we included, the requirements of that unit are \*merged\* with the requirements of this unit.
|
|
|
|
|
|
|
|
|
Presently, this merging process is carried out by `mergeRequirements`, which successively adds inherited required types/values from included units to the type/environment of the `hsig` file being compiled. Any requirements for which we don't have a local `hsig` implicitly have a "blank" signature file which collects together the merged requirements.
|
|
|
|
|
|
TODO Unclear how to handle dependency cycles here.
|
|
|
|
|
|
### The database
|
|
|
|
|
|
|
|
|
The package database contains both entries for old-fashioned definite units/packages, and also entries for indefinite unit, which contain code but no objects. Conventionally, the unit ID for an indefinite is simply the unit ID with all of the requirements filled in with `hole`s.
|
|
|
|
|
|
### Unit IDs
|
|
|
|
|
|
|
|
|
(About the hashing)
|
|
|
|
|
|
## Backpack-related tickets
|
|
|
|
|
|
|
|
|
Backpack-related tickets are marked with keyword 'backpack'. If the ticket is assigned to ezyang, it means he's planning on working on it.
|
|
|
|
|
|
<table><tr><th>Ticket (Ticket query: keywords: backpack, status: new, max: 0, col: id, col: type, col: summary, col: priority, col: owner, order: id)</th>
|
|
|
<th>Type (Ticket query: keywords: backpack, status: new, max: 0, col: id, col: type, col: summary, col: priority, col: owner, order: type)</th>
|
|
|
<th>Summary (Ticket query: keywords: backpack, status: new, max: 0, col: id, col: type, col: summary, col: priority, col: owner, order: summary)</th>
|
|
|
<th>Priority (Ticket query: keywords: backpack, status: new, max: 0, col: id, col: type, col: summary, col: priority, col: owner, desc: 1, order: priority)</th>
|
|
|
<th>Owner (Ticket query: keywords: backpack, status: new, max: 0, col: id, col: type, col: summary, col: priority, col: owner, order: owner)</th></tr>
|
|
|
<tr><th>[\#1409](https://gitlab.haskell.org//ghc/ghc/issues/1409)</th>
|
|
|
<th>
|
|
|
|
... | ... | @@ -1656,66 +652,4 @@ Backpack-related tickets are marked with keyword 'backpack'. If the ticket is as |
|
|
|
|
|
lowest
|
|
|
</th>
|
|
|
<th></th></tr>
|
|
|
<tr><th>## Status: patch (2 matches)
|
|
|
|
|
|
</th>
|
|
|
<th></th>
|
|
|
<th></th>
|
|
|
<th></th>
|
|
|
<th></th></tr>
|
|
|
<tr><th>Ticket (Ticket query: keywords: backpack, group: status, max: 0, col: id, col: type, col: summary, col: priority, col: owner, order: id)</th>
|
|
|
<th>Type (Ticket query: keywords: backpack, group: status, max: 0, col: id, col: type, col: summary, col: priority, col: owner, order: type)</th>
|
|
|
<th>Summary (Ticket query: keywords: backpack, group: status, max: 0, col: id, col: type, col: summary, col: priority, col: owner, order: summary)</th>
|
|
|
<th>Priority (Ticket query: keywords: backpack, group: status, max: 0, col: id, col: type, col: summary, col: priority, col: owner, desc: 1, order: priority)</th>
|
|
|
<th>Owner (Ticket query: keywords: backpack, group: status, max: 0, col: id, col: type, col: summary, col: priority, col: owner, order: owner)</th></tr>
|
|
|
<tr><th>[\#15594](https://gitlab.haskell.org//ghc/ghc/issues/15594)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bug
|
|
|
</th>
|
|
|
<th>[--abi-hash with Backpack incorrectly loads modules from dependent packages](https://gitlab.haskell.org//ghc/ghc/issues/15594)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
normal
|
|
|
</th>
|
|
|
<th></th></tr>
|
|
|
<tr><th>[\#16219](https://gitlab.haskell.org//ghc/ghc/issues/16219)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bug
|
|
|
</th>
|
|
|
<th>[Backpack - TH+indefinite module interface file error](https://gitlab.haskell.org//ghc/ghc/issues/16219)</th>
|
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
normal
|
|
|
</th>
|
|
|
<th></th></tr></table> |
|
|
\ No newline at end of file |