[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). (6e7710f)

git at git.haskell.org git at git.haskell.org
Thu Jul 10 02:54:57 UTC 2014


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

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

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

commit 6e7710f4bd0ae3d7105fa9b026c4c422dca6cfc0
Author: Dr. ERDI Gergo <gergo at erdi.hu>
Date:   Thu Jul 10 10:15:42 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]


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

6e7710f4bd0ae3d7105fa9b026c4c422dca6cfc0
 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 6e7710f4bd0ae3d7105fa9b026c4c422dca6cfc0


More information about the ghc-commits mailing list