[commit: ghc] master: Refactor checking for GADT-like datacons' return types (3cd1360)

Richard Eisenberg eir at ghc.haskell.org
Sun Aug 4 18:25:20 CEST 2013


Repository : http://darcs.haskell.org/ghc.git/

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/3cd1360f05e5f2052cb5671195f8668446fae550

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

commit 3cd1360f05e5f2052cb5671195f8668446fae550
Author: Richard Eisenberg <eir at cis.upenn.edu>
Date:   Sun Aug 4 16:45:02 2013 +0100

    Refactor checking for GADT-like datacons' return types
    
    This check is somewhat subtle. See Note [Checking GADT return types]
    in TcTyClsDecls. The new plan is to check *before* desugaring the type
    from HsType to Type. This avoids problems with the pattern-match
    in rejigConRes.
    
    As a nice side benefit to this, I discovered that Template Haskell
    splices were a little conservative in their treatment of valid data
    constructors. (For example, a kind signature in the return type caused
    failure.) Now, the TH code uses exactly the same function as the
    "real" code, which is nice. See hsTyGetAppHead_maybe in HsTypes.

 compiler/deSugar/DsMeta.hs          |    3 +-
 compiler/hsSyn/HsTypes.lhs          |   16 +++-
 compiler/typecheck/TcInstDcls.lhs   |    6 +-
 compiler/typecheck/TcTyClsDecls.lhs |  152 ++++++++++++++++++-----------------
 4 files changed, 98 insertions(+), 79 deletions(-)


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

    git show 3cd1360f05e5f2052cb5671195f8668446fae550




More information about the ghc-commits mailing list