[commit: ghc] master: Don't split the arg types in a PatSyn signature (03d8960)

git at git.haskell.org git at git.haskell.org
Tue May 24 08:47:10 UTC 2016


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/03d8960388d64f5d5c9617dd0e21555e9e987e26/ghc

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

commit 03d8960388d64f5d5c9617dd0e21555e9e987e26
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Thu May 19 15:02:09 2016 +0100

    Don't split the arg types in a PatSyn signature
    
    This patch fixes Trac #11977, and #12108, rather satisfactorily
    maily by deleting code!
    
      pattern P :: Eq a => a -> a -> Int
    
    The idea is simply /not/ to split the bit after the '=>' into the
    pattern argument types, but to keep the (a->a->Int) part
    un-decomposed, in the patsig_body_ty field of a TcPatSynInfo.
    
    There is one awkward wrinkle, which is that we can't split the
    implicitly-bound type variables into existential and universal until
    we know which types are arguments and which are part of the result.
    So we postpone the decision until we have the declaration in hand.
    See TcPatSyn Note [The pattern-synonym signature splitting rule]


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

03d8960388d64f5d5c9617dd0e21555e9e987e26
 compiler/typecheck/TcExpr.hs                    |   2 +-
 compiler/typecheck/TcPatSyn.hs                  | 177 +++++++++++++-----------
 compiler/typecheck/TcRnTypes.hs                 |  16 ++-
 compiler/typecheck/TcType.hs                    |  32 +++--
 testsuite/tests/patsyn/should_compile/T11977.hs |   8 ++
 testsuite/tests/patsyn/should_compile/T12108.hs |   8 ++
 testsuite/tests/patsyn/should_compile/all.T     |   2 +
 7 files changed, 145 insertions(+), 100 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 03d8960388d64f5d5c9617dd0e21555e9e987e26


More information about the ghc-commits mailing list