Split base for Backpack
|Reported by:||ezyang||Owned by:||ezyang|
|Keywords:||backpack||Cc:||lelf, hvr, ekmett, luite, nomeata, Ericson2314, ibotty|
|Type of failure:||None/Unknown||Test Case:|
|Related Tickets:||Differential Rev(s):|
Description (last modified by )
Let's resurrect #1338 and #1580. Our new concrete goal is to have users be able to replace 'base' with 'base-sig', which is some signature representing the modules from 'base' which we depend on. Since 'base' is a big, complicated package, the ability to specify subsets of 'base' is very useful: it can be used to define things like Haskell'98 base, base without any unsafe operations, etc.
Right now, all wired in things live in ghc-prim (I believe). This is good, since we can't reasonably abstract wired in things away with a signature: GHC will always put them in some well-known place. However, this is not enough: there are many known-key/Rdr things the compiler knows about too, which need to be placed in specific package + module locations for GHC to be able to reference them; e.g. when deriving instances, etc.
At the moment, most of these identifiers live in 'base', which is no good: even if we make base sig abstract, GHC will still go right ahead and try to use a specific implementation of base. So, here's the proposal: all non-rebindable GHC-known identifiers (as per PrelNames) should be moved to ghc-prim (or perhaps a new package? I don't really care either way) and reexported from the old packages which they were available from base. The further upshot is base now truly can have an implementation replaced: ghc-prim is the ONLY package which must be used verbatim (since GHC hardcodes to it.)
I'll try to work out in detail what moves, how to avoid orphan instances, etc.