Changes between Version 24 and Version 25 of SplitBase

Mar 13, 2013 2:45:14 PM (14 months ago)



  • SplitBase

    v24 v25  
    8484 * Possibly fewer modules in “magic” packages that cannot be installed via cabal. 
     86=== Handling Prelude === 
     88If there is no longer one base package that all package depend on, the question where the Prelude will be arises. This is issue is mostly independent of the choice of approaches to splitting base. 
     90Some options to handling Prelude include: 
     92 * (P1) Prelude stays in base, packages wanting to use the shim packages exclusively have to use `{-# LANGUAGE NoImplicitPrelude #-}` everywhere and import stuff explicitly. base-pure would probably provide its subset of the Prelude in Prelude.Pure, to be imported explicitly. 
     93 * (P2) Prelude goes to the first shim package that has everything required for Haskell98 (probably something like base-io-file). Packages that want to only use base-io have no Prelude to use (see (P1)). 
     94 * (P2) Prelude goes to a separate shim package, base-prelude. Packages that want to only use base-io have no Prelude to use (see (P1)). Allows packages to mix the shim-packages easily with other, non-standard Prelude providing packages, e.g. classy-prelude. 
     95 * (P4) Multiple shim packages have a Prelude module, providing the part of the Prelude that belongs to that shim package.. Good for those who depend on base-pure, but those who require both base-pure and base-io have now an ambiguous import. 
     96 * (P5) Separate packages base-io-prelude and base-pure-prelude providing Prelude’s containing stuff of base-* (+ dependencies). Packages can pull in precisely the Prelude they want, but yet more packages. 
     98None of these look particularly appealing. Here some ideas to make it more convenient for the programmer that require changes to GHC and how it treats packages: 
     100 * (I1) It automatically imports _all_ visible Prelude modules. So base-pure provides the pure Prelude and base-io adds the IO functions. 
     101 * (I2) Same, but a bit more explicit: We extend the package configuration by a "prelude-modules" field. Every module listed in that field of every visible package is treated as a Prelude and automatically imported (unless `{-# LANGUAGE NoImplicitPreldue #-}` is active.) 
     102 * (I3) Ambiguous module imports do not cause an error if, among the modules, there is one that is a superset of all others, i.e. reexports all other modules. 
     104Joachim's preference: I find (P4)+(I1) quilte elegant and appealing. 
     106SPJ’s gut feeling prefers (P2): The minority who do not want to depend on enough base-X packages to get the Haskell-98 Prelude should use NoImplicitPrelude (since indeed you don't depend on enough to get the H98 Prelude) and import what they want explicitly. 
    86109=== Non-Obvious interdependencies ===