[commit: ghc] wip/pattern-synonyms: When typechecking a pattern synonym, the typechecking the definition of the wrapper can be deferred until after everything else is checked (since the expression-type of the pattern synonym can be determined without looking at the wrapper). (fa3fc76)

git at git.haskell.org git at git.haskell.org
Tue Jul 8 12:26:00 UTC 2014


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

On branch  : wip/pattern-synonyms
Link       : http://ghc.haskell.org/trac/ghc/changeset/fa3fc76ad77611091afeb4c017be932b908c1ee5/ghc

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

commit fa3fc76ad77611091afeb4c017be932b908c1ee5
Author: Dr. ERDI Gergo <gergo at erdi.hu>
Date:   Tue Jul 8 20:25:22 2014 +0800

    When typechecking a pattern synonym, the typechecking the definition of the wrapper
    can be deferred until after everything else is checked (since the
    expression-type of the pattern synonym can be determined without looking
    at the wrapper).
    
    This is needed so that something like this typechecks, without regarding it
    as a recursive pattern synonym:
    
    pattern P x <- (x:_) where
      P x = foo [x]
    
    foo (P x) = [x, x]


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

fa3fc76ad77611091afeb4c017be932b908c1ee5
 compiler/rename/RnBinds.lhs          |  2 +-
 compiler/typecheck/TcBinds.lhs       | 70 +++++++++++++++++-------------
 compiler/typecheck/TcPatSyn.lhs      | 82 ++++++++++++++++++++----------------
 compiler/typecheck/TcPatSyn.lhs-boot |  2 +-
 4 files changed, 87 insertions(+), 69 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 fa3fc76ad77611091afeb4c017be932b908c1ee5


More information about the ghc-commits mailing list