Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/5a8ac0f823c151c062a3f1903574030423bb255c

>---------------------------------------------------------------

commit 5a8ac0f823c151c062a3f1903574030423bb255c
Author: Simon Peyton Jones <[email protected]>
Date:   Wed Jun 13 17:21:09 2012 +0100

    Simplify the implementation of Implicit Parameters
    
    This patch re-implements implicit parameters via a class
    with a functional dependency:
    
        class IP (n::Symbol) a | n -> a where
          ip :: a
    
    This definition is in the library module GHC.IP. Notice
    how it use a type-literal, so we can have constraints like
       IP "x" Int
    Now all the functional dependency machinery works right to make
    implicit parameters behave as they should.
    
    Much special-case processing for implicit parameters can be removed
    entirely. One particularly nice thing is not having a dedicated
    "original-name cache" for implicit parameters (the nsNames field of
    NameCache).  But many other cases disappear:
    
      * BasicTypes.IPName
      * IPTyCon constructor in Tycon.TyCon
      * CIPCan constructor  in TcRnTypes.Ct
      * IPPred constructor  in Types.PredTree
    
    Implicit parameters remain special in a few ways:
    
     * Special syntax.  Eg the constraint (IP "x" Int) is parsed
       and printed as (?x::Int).  And we still have local bindings
       for implicit parameters, and occurrences thereof.
    
     * A implicit-parameter binding  (let ?x = True in e) amounts
       to a local instance declaration, which we have not had before.
       It just generates an implication contraint (easy), but when
       going under it we must purge any existing bindings for
       ?x in the inert set.  See Note [Shadowing of Implicit Parameters]
       in TcSimplify
    
     * TcMType.sizePred classifies implicit parameter constraints as size-0,
       as before the change
    
    There are accompanying patches to libraries 'base' and 'haddock'
    
    All the work was done by Iavor Diatchki

 compiler/basicTypes/BasicTypes.lhs |   28 ---------
 compiler/basicTypes/Unique.lhs     |    3 -
 compiler/coreSyn/MkCore.lhs        |   23 +-------
 compiler/deSugar/DsExpr.lhs        |    6 +-
 compiler/ghc.cabal.in              |    1 -
 compiler/hsSyn/HsBinds.lhs         |   13 +++-
 compiler/hsSyn/HsExpr.lhs          |    2 +-
 compiler/hsSyn/HsTypes.lhs         |   21 ++++++-
 compiler/iface/BinIface.hs         |   20 +------
 compiler/iface/IfaceEnv.lhs        |   24 +-------
 compiler/iface/IfaceType.lhs       |   19 +------
 compiler/iface/TcIface.lhs         |    2 -
 compiler/main/DynFlags.hs          |    5 ++
 compiler/main/HscTypes.lhs         |   10 +---
 compiler/parser/Parser.y.pp        |    6 +-
 compiler/prelude/PrelNames.lhs     |   15 +++++-
 compiler/prelude/TysWiredIn.lhs    |   41 +-------------
 compiler/rename/RnBinds.lhs        |    7 +-
 compiler/rename/RnExpr.lhs         |    3 +-
 compiler/rename/RnTypes.lhs        |   11 +---
 compiler/typecheck/Inst.lhs        |    2 -
 compiler/typecheck/TcBinds.lhs     |   27 +++++++--
 compiler/typecheck/TcCanonical.lhs |   46 ---------------
 compiler/typecheck/TcErrors.lhs    |    6 +-
 compiler/typecheck/TcExpr.lhs      |   27 ++++++---
 compiler/typecheck/TcHsSyn.lhs     |   11 ++--
 compiler/typecheck/TcHsType.lhs    |    6 ++-
 compiler/typecheck/TcInteract.lhs  |  112 ++++++++++++++++++++----------------
 compiler/typecheck/TcMType.lhs     |   42 ++++---------
 compiler/typecheck/TcRnTypes.lhs   |   23 +------
 compiler/typecheck/TcSMonad.lhs    |   25 ++------
 compiler/typecheck/TcSimplify.lhs  |   65 ++++++++++++++++++++-
 compiler/typecheck/TcSplice.lhs    |    8 ++-
 compiler/typecheck/TcType.lhs      |    5 +-
 compiler/types/IParam.lhs          |   41 -------------
 compiler/types/IParam.lhs-boot     |   10 ---
 compiler/types/TyCon.lhs           |   15 +-----
 compiler/types/Type.lhs            |   42 +++++---------
 compiler/types/TypeRep.lhs         |   12 ++--
 39 files changed, 307 insertions(+), 478 deletions(-)


Diff suppressed because of size. To see it, use:

    git show 5a8ac0f823c151c062a3f1903574030423bb255c

_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to