cvs commit: fptools/ghc/compiler/hsSyn HsExpr.lhs HsPat.lhs HsLit.lhs fptools/ghc/compiler/parser ParseUtil.lhs Parser.y fptools/ghc/compiler/prelude PrelNames.lhs fptools/ghc/compiler/rename Rename.lhs RnEnv.lhs RnExpr.lhs RnHsSyn.lhs ...

Simon Peyton Jones simonpj@glass.cse.ogi.edu
Tue, 20 Feb 2001 01:40:46 -0800


simonpj     2001/02/20 01:40:45 PST

  Modified files:
    ghc/compiler/hsSyn   HsExpr.lhs HsPat.lhs HsLit.lhs 
    ghc/compiler/parser  ParseUtil.lhs Parser.y 
    ghc/compiler/prelude PrelNames.lhs 
    ghc/compiler/rename  Rename.lhs RnEnv.lhs RnExpr.lhs 
                         RnHsSyn.lhs 
    ghc/compiler/typecheck Inst.lhs TcEnv.lhs TcMonad.lhs 
                           TcPat.lhs TcExpr.lhs 
  Log:
  Decoupling the Prelude [HsExpr, HsLit, HsPat, ParseUtil, Parser.y, PrelNames,
  ~~~~~~~~~~~~~~~~~~~~~~  Rename, RnEnv, RnExpr, RnHsSyn, Inst, TcEnv, TcMonad,
  			TcPat, TcExpr]
  The -fno-implicit-prelude flag is meant to arrange that when you write
  	3
  you get
  	fromInt 3
  where 'fromInt' is whatever fromInt is in scope at the top level of
  the module being compiled.  Similarly for
  	* numeric patterns
  	* n+k patterns
  	* negation
  
  This used to work, but broke when we made the static/dynamic flag distinction.
  It's now tidied up a lot.  Here's the plan:
  
    - PrelNames contains sugarList :: SugarList, which maps built-in names
      to the RdrName that should replace them.  
  
    - The renamer makes a finite map :: SugarMap, which maps the built-in names
      to the Name of the re-mapped thing
  
    - The typechecker consults this map via tcLookupSyntaxId when it is doing
      numeric things
  
  At present I've only decoupled numeric syntax, since that is the main demand,
  but the scheme is much more robustly extensible than the previous method.
  
  As a result some HsSyn constructors don't need to carry names in them
  (notably HsOverLit, NegApp, NPlusKPatIn)
  
  
  Revision  Changes    Path
  1.46      +2 -3      fptools/ghc/compiler/hsSyn/HsExpr.lhs
  1.30      +5 -9      fptools/ghc/compiler/hsSyn/HsPat.lhs
  1.5       +14 -16    fptools/ghc/compiler/hsSyn/HsLit.lhs
  1.27      +2 -2      fptools/ghc/compiler/parser/ParseUtil.lhs
  1.53      +6 -4      fptools/ghc/compiler/parser/Parser.y
  1.24      +48 -0     fptools/ghc/compiler/prelude/PrelNames.lhs
  1.152     +41 -137   fptools/ghc/compiler/rename/Rename.lhs
  1.107     +158 -36   fptools/ghc/compiler/rename/RnEnv.lhs
  1.67      +27 -29    fptools/ghc/compiler/rename/RnExpr.lhs
  1.52      +0 -1      fptools/ghc/compiler/rename/RnHsSyn.lhs
  1.72      +11 -15    fptools/ghc/compiler/typecheck/Inst.lhs
  1.85      +23 -4     fptools/ghc/compiler/typecheck/TcEnv.lhs
  1.58      +4 -3      fptools/ghc/compiler/typecheck/TcMonad.lhs
  1.58      +7 -6      fptools/ghc/compiler/typecheck/TcPat.lhs
  1.93      +5 -4      fptools/ghc/compiler/typecheck/TcExpr.lhs