[GHC] #10266: Split base for Backpack

GHC ghc-devs at haskell.org
Wed Apr 8 08:29:47 UTC 2015


#10266: Split base for Backpack
-------------------------------------+-------------------------------------
        Reporter:  ezyang            |                   Owner:  ezyang
            Type:  task              |                  Status:  new
        Priority:  normal            |               Milestone:
       Component:  libraries/base    |                 Version:  7.11
      Resolution:                    |                Keywords:  backpack
Operating System:  Unknown/Multiple  |            Architecture:
 Type of failure:  None/Unknown      |  Unknown/Multiple
      Blocked By:                    |               Test Case:
 Related Tickets:                    |                Blocking:
                                     |  Differential Revisions:
-------------------------------------+-------------------------------------
Description changed by ezyang:

Old description:

> 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. 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. I'll try to work out in detail what
> moves, how to avoid orphan instances, etc.

New description:

 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.

--

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10266#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list