Opened 2 years ago

Last modified 11 months ago

#10266 new task

Split base for Backpack

Reported by: ezyang Owned by: ezyang
Priority: low Milestone:
Component: libraries/base Version: 7.11
Keywords: backpack Cc: lelf, hvr, ekmett, luite, nomeata, Ericson2314, ibotty
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description (last modified by ezyang)

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.

Change History (7)

comment:1 Changed 2 years ago by ezyang

Description: modified (diff)

comment:2 Changed 2 years ago by ekmett

It'd be good to keep Luite and Joachim in the loop as they had been the biggest proponents of split base in the first place and intended to lead the charge from the core libraries committee front.

comment:3 Changed 22 months ago by ezyang

Priority: normallow

comment:4 Changed 20 months ago by thomie

Cc: luite nomeata added

See also the wiki page on SplitBase.

comment:5 Changed 13 months ago by Ericson2314

Cc: Ericson2314 added

comment:6 Changed 11 months ago by ibotty

Cc: ibotty added

comment:7 Changed 11 months ago by lelf

Cc: lelf added
Note: See TracTickets for help on using tickets.