[commit: ghc] overlapping-tyfams: Made changes to HsDecls to support multiple equations in a (89bd484)

Richard Eisenberg eir at cis.upenn.edu
Wed Aug 15 17:00:25 CEST 2012


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

On branch  : overlapping-tyfams

http://hackage.haskell.org/trac/ghc/changeset/89bd484b6e9a2312761380c274c992218e6c307e

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

commit 89bd484b6e9a2312761380c274c992218e6c307e
Author: Richard Eisenberg <eir at seas.upenn.edu>
Date:   Fri Jul 13 18:40:43 2012 +0100

    Made changes to HsDecls to support multiple equations in a
    type family group. Now there is a TyFamInstEqn type that tracks
    the details of a single family instance; the TyFamInstDecl type
    contains a list of TyFamInstEqn's. To make this change, I
    also separated data instances from type instances, making a
    new DataFamInstDecl type. Another knock-on effect (that Simon
    PJ approved) was to specialize HsTyDefn (which used to track both
    'type' and 'data' declarations) just to data declarations.
    
    A type family group with multiple instance equations is rejected
    by the type-checker, as Core has no way to deal with such a thing
    (yet). The pretty-printer can deal with multiple equations (printing
    them under a 'type instance where' header) as can the renamer.
    Template Haskell cannot deal with them (yet).
    
    One bugfix: It used to be that you could make an associated
    default data family instance using Template Haskell. This
    caused a panic (because associated default data family instances
    are not allowed). (Normally, an attempt to make such aa thing
    is not allowed to parse.) This bug is fixed, and Convert.lhs
    reports an error if you try this.

 compiler/deSugar/DsMeta.hs                        |   79 +++++--
 compiler/hsSyn/Convert.lhs                        |   92 ++++----
 compiler/hsSyn/HsDecls.lhs                        |  258 ++++++++++++---------
 compiler/hsSyn/HsUtils.lhs                        |   27 ++-
 compiler/main/HscStats.hs                         |   17 +-
 compiler/parser/Parser.y.pp                       |   43 ++--
 compiler/parser/ParserCore.y                      |   20 +-
 compiler/parser/RdrHsSyn.lhs                      |   85 ++++---
 compiler/rename/RnNames.lhs                       |   20 +-
 compiler/rename/RnSource.lhs                      |  179 +++++++++-----
 compiler/rename/RnTypes.lhs                       |   10 +-
 compiler/typecheck/TcDeriv.lhs                    |   21 +-
 compiler/typecheck/TcGenGenerics.lhs              |   13 +-
 compiler/typecheck/TcInstDcls.lhs                 |  114 ++++++----
 compiler/typecheck/TcRnDriver.lhs                 |   11 +-
 compiler/typecheck/TcTyClsDecls.lhs               |  144 ++++++++----
 compiler/types/FamInstEnv.lhs                     |   40 ++--
 compiler/vectorise/Vectorise/Generic/PAMethods.hs |    3 +-
 compiler/vectorise/Vectorise/Generic/PData.hs     |    3 +-
 19 files changed, 712 insertions(+), 467 deletions(-)


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

    git show 89bd484b6e9a2312761380c274c992218e6c307e



More information about the Cvs-ghc mailing list