Tue Jul 25 06:01:54 PDT 2006  Simon Marlow <[EMAIL PROTECTED]>
  * Generalise Package Support
  
  This patch pushes through one fundamental change: a module is now
  identified by the pair of its package and module name, whereas
  previously it was identified by its module name alone.  This means
  that now a program can contain multiple modules with the same name, as
  long as they belong to different packages.
  
  This is a language change - the Haskell report says nothing about
  packages, but it is now necessary to understand packages in order to
  understand GHC's module system.  For example, a type T from module M
  in package P is different from a type T from module M in package Q.
  Previously this wasn't an issue because there could only be a single
  module M in the program.
  
  The "module restriction" on combining packages has therefore been
  lifted, and a program can contain multiple versions of the same
  package.
  
  Note that none of the proposed syntax changes have yet been
  implemented, but the architecture is geared towards supporting import
  declarations qualified by package name, and that is probably the next
  step.
  
  It is now necessary to specify the package name when compiling a
  package, using the -package-name flag (which has been un-deprecated).
  Fortunately Cabal still uses -package-name.
  
  Certain packages are "wired in".  Currently the wired-in packages are:
  base, haskell98, template-haskell and rts, and are always referred to
  by these versionless names.  Other packages are referred to with full
  package IDs (eg. "network-1.0").  This is because the compiler needs
  to refer to entities in the wired-in packages, and we didn't want to
  bake the version of these packages into the comiler.  It's conceivable
  that someone might want to upgrade the base package independently of
  GHC.
  
  Internal changes:
  
    - There are two module-related types:
  
          ModuleName      just a FastString, the name of a module
          Module          a pair of a PackageId and ModuleName
  
      A mapping from ModuleName can be a UniqFM, but a mapping from Module
      must be a FiniteMap (we provide it as ModuleEnv).
  
    - The "HomeModules" type that was passed around the compiler is now
      gone, replaced in most cases by the current package name which is
      contained in DynFlags.  We can tell whether a Module comes from the
      current package by comparing its package name against the current
      package.
  
    - While I was here, I changed PrintUnqual to be a little more useful:
      it now returns the ModuleName that the identifier should be qualified
      with according to the current scope, rather than its original
      module.  Also, PrintUnqual tells whether to qualify module names with
      package names (currently unused).
  
  Docs to follow.

    M ./compiler/Makefile -7 +24
    A ./compiler/Makefile.ghcbin
    M ./compiler/basicTypes/MkId.lhs -9 +9
    M ./compiler/basicTypes/Module.lhs -68 +127
    M ./compiler/basicTypes/Module.lhs-boot -1 +5
    M ./compiler/basicTypes/Name.lhs -12 +11
    M ./compiler/basicTypes/RdrName.lhs -25 +31
    M ./compiler/cmm/CLabel.hs -21 +21
    M ./compiler/cmm/CmmParse.y -4 +3
    M ./compiler/codeGen/CgBindery.lhs -2 +2
    M ./compiler/codeGen/CgCase.lhs -2 +2
    M ./compiler/codeGen/CgCon.lhs -13 +13
    M ./compiler/codeGen/CgExpr.lhs -10 +10
    M ./compiler/codeGen/CgForeignCall.hs -2 +1
    M ./compiler/codeGen/CgHeapery.lhs -4 +4
    M ./compiler/codeGen/CgMonad.lhs -12 +10
    M ./compiler/codeGen/CgProf.hs -1 +1
    M ./compiler/codeGen/CgTailCall.lhs -2 +2
    M ./compiler/codeGen/CgUtils.hs -7 +5
    M ./compiler/codeGen/ClosureInfo.lhs -24 +24
    M ./compiler/codeGen/CodeGen.lhs -28 +27
    M ./compiler/coreSyn/CoreUtils.lhs -4 +4
    M ./compiler/coreSyn/MkExternalCore.lhs -1 +1
    M ./compiler/deSugar/Desugar.lhs -14 +15
    M ./compiler/deSugar/DsForeign.lhs -3 +3
    M ./compiler/deSugar/DsMeta.hs -10 +14
    M ./compiler/deSugar/DsMonad.lhs -2 +2
    M ./compiler/ghci/ByteCodeLink.lhs -6 +17
    M ./compiler/ghci/InteractiveUI.hs -53 +69
    M ./compiler/ghci/Linker.lhs -24 +30
    M ./compiler/hsSyn/Convert.lhs -4 +8
    M ./compiler/hsSyn/HsImpExp.lhs -4 +4
    M ./compiler/hsSyn/HsSyn.lhs -2 +2
    M ./compiler/iface/BinIface.hs -3
    M ./compiler/iface/IfaceEnv.lhs -5 +11
    M ./compiler/iface/IfaceType.lhs -21 +12
    M ./compiler/iface/LoadIface.lhs -82 +75
    M ./compiler/iface/MkIface.lhs -54 +56
    M ./compiler/iface/TcIface.lhs -6 +7
    M ./compiler/main/CodeOutput.lhs -9 +7
    M ./compiler/main/DriverMkDepend.hs -15 +14
    M ./compiler/main/DriverPipeline.hs -30 +26
    M ./compiler/main/DynFlags.hs -6 +19
    M ./compiler/main/Finder.lhs -164 +210
    M ./compiler/main/GHC.hs -118 +147
    M ./compiler/main/HeaderInfo.hs -9 +7
    M ./compiler/main/HscMain.lhs -10 +10
    M ./compiler/main/HscTypes.lhs -77 +131
    M ./compiler/main/PackageConfig.hs -2 +46
    M ./compiler/main/Packages.lhs -175 +95
    M ./compiler/main/TidyPgm.lhs -16 +15
    M ./compiler/ndpFlatten/FlattenMonad.hs -5 +8
    M ./compiler/parser/Parser.y.pp -4 +4
    M ./compiler/parser/ParserCore.y -1 +3
    M ./compiler/prelude/PrelNames.lhs -172 +186
    M ./compiler/prelude/TysWiredIn.lhs -17 +17
    M ./compiler/profiling/CostCentre.lhs -6 +4
    M ./compiler/profiling/SCCfinal.lhs -5 +10
    M ./compiler/rename/RnEnv.lhs -22 +23
    M ./compiler/rename/RnExpr.lhs -2 +2
    M ./compiler/rename/RnNames.lhs -39 +41
    M ./compiler/simplStg/SimplStg.lhs -4 +3
    M ./compiler/stgSyn/CoreToStg.lhs -17 +17
    M ./compiler/stgSyn/StgSyn.lhs -9 +8
    M ./compiler/typecheck/Inst.lhs -5 +5
    M ./compiler/typecheck/TcEnv.lhs -1 +2
    M ./compiler/typecheck/TcRnDriver.lhs -46 +21
    M ./compiler/typecheck/TcRnMonad.lhs -31 +11
    M ./compiler/typecheck/TcRnTypes.lhs -18 +15
    M ./compiler/typecheck/TcSplice.lhs -9 +15
    M ./compiler/utils/Outputable.lhs -22 +58
_______________________________________________
Cvs-ghc mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to