[commit: ghc] master: Entirely re-jig the handling of default type-family instances (fixes Trac #9063) (9b8ba62)

git at git.haskell.org git at git.haskell.org
Tue Jul 15 06:57:19 UTC 2014


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/9b8ba62991ae22420a0c4486127a3b22ee7f22bd/ghc

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

commit 9b8ba62991ae22420a0c4486127a3b22ee7f22bd
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Tue Jul 15 07:43:55 2014 +0100

    Entirely re-jig the handling of default type-family instances (fixes Trac #9063)
    
    In looking at Trac #9063 I decided to re-design the default
    instances for associated type synonyms.  Previously it was all
    jolly complicated, to support generality that no one wanted, and
    was arguably undesirable.
    
    Specifically
    
    * The default instance for an associated type can have only
      type variables on the LHS.  (Not type patterns.)
    
    * There can be at most one default instances declaration for
      each associated type.
    
    To achieve this I had to do a surprisingly large amount of refactoring
    of HsSyn, specifically to parameterise HsDecls.TyFamEqn over the type
    of the LHS patterns.
    
    That change in HsDecls has a (trivial) knock-on effect in Haddock, so
    this commit does a submodule update too.
    
    The net result is good though.  The code is simpler; the language
    specification is simpler.  Happy days.
    
    Trac #9263 and #9264 are thereby fixed as well.


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

9b8ba62991ae22420a0c4486127a3b22ee7f22bd
 compiler/deSugar/DsMeta.hs                         |   8 +-
 compiler/hsSyn/Convert.lhs                         |  15 +-
 compiler/hsSyn/HsDecls.lhs                         |  97 +++++----
 compiler/iface/IfaceSyn.lhs                        |  23 ++-
 compiler/iface/MkIface.lhs                         |  91 +++++----
 compiler/iface/TcIface.lhs                         |  11 +-
 compiler/parser/RdrHsSyn.lhs                       |  74 +++++--
 compiler/rename/RnSource.lhs                       |  45 +++--
 compiler/typecheck/TcDeriv.lhs                     |   4 +-
 compiler/typecheck/TcInstDcls.lhs                  |  93 +++++----
 compiler/typecheck/TcRnDriver.lhs                  |  13 +-
 compiler/typecheck/TcTyClsDecls.lhs                | 224 +++++++++++----------
 compiler/typecheck/TcValidity.lhs                  |  25 +--
 compiler/types/Class.lhs                           |  47 ++++-
 docs/users_guide/glasgow_exts.xml                  | 103 +++++++---
 .../indexed-types/should_fail/Overlap4.stderr      |   1 -
 .../indexed-types/should_fail/Overlap5.stderr      |   7 +-
 .../indexed-types/should_fail/SimpleFail1a.stderr  |   2 +-
 .../indexed-types/should_fail/SimpleFail1b.stderr  |   2 +-
 .../indexed-types/should_fail/SimpleFail4.stderr   |  10 +-
 testsuite/tests/parser/should_fail/T8506.stderr    |   2 +-
 .../tests/parser/should_fail/readFail025.stderr    |   2 +-
 testsuite/tests/polykinds/Makefile                 |   6 +
 testsuite/tests/polykinds/T7939a.stderr            |   2 +-
 testsuite/tests/polykinds/T9063.hs                 |  16 ++
 testsuite/tests/polykinds/T9263.hs                 |   2 +
 testsuite/tests/polykinds/T9263a.hs                |   9 +
 testsuite/tests/polykinds/T9263b.hs                |   8 +
 testsuite/tests/polykinds/T9264.hs                 |   6 +
 testsuite/tests/polykinds/all.T                    |   3 +
 .../tests/typecheck/should_compile/T5481.stderr    |   8 +-
 testsuite/tests/typecheck/should_compile/tc253.hs  |   7 +-
 .../typecheck/should_fail/AssocTyDef02.stderr      |  10 +-
 .../typecheck/should_fail/AssocTyDef03.stderr      |   2 +-
 .../typecheck/should_fail/AssocTyDef04.stderr      |   2 +-
 .../typecheck/should_fail/AssocTyDef05.stderr      |   4 +-
 .../typecheck/should_fail/AssocTyDef06.stderr      |   9 +-
 utils/haddock                                      |   2 +-
 38 files changed, 616 insertions(+), 379 deletions(-)

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

    git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 9b8ba62991ae22420a0c4486127a3b22ee7f22bd


More information about the ghc-commits mailing list