[commit: ghc] wip/rae: Fix #1476 by allowing pattern splices to bind variables. (f6a93f6)

git at git.haskell.org git at git.haskell.org
Tue Nov 4 02:10:16 UTC 2014


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

On branch  : wip/rae
Link       : http://ghc.haskell.org/trac/ghc/changeset/f6a93f69d893fa343b1bb50e576299f9aeb07f5d/ghc

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

commit f6a93f69d893fa343b1bb50e576299f9aeb07f5d
Author: Richard Eisenberg <eir at cis.upenn.edu>
Date:   Mon Nov 3 20:20:41 2014 -0500

    Fix #1476 by allowing pattern splices to bind variables.
    
    Operationally, this is quite simple: just rename the RHS of a
    pattern in the right scope, after running a pattern splice.
    Now that splices are run in the renamer, this is easy.
    
    From a coding standpoint, it's rather painful, because there's
    a moderate-sized impedance mismatch between the code in RnPat and
    RnSplice. The monads are different (CpsRn vs RnM) as are the callback
    types in a call to rnSpliceGen. Throw in the necessity of lhs-boot
    files, and it all gets a little ugly.
    
    Suggestions to make this less ugly are strongly encouraged.


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

f6a93f69d893fa343b1bb50e576299f9aeb07f5d
 compiler/rename/RnPat.lhs         | 49 +++++++++++++++++++++++++++----
 compiler/rename/RnSplice.lhs      | 61 ++++++++++++++-------------------------
 compiler/rename/RnSplice.lhs-boot |  8 ++++-
 testsuite/tests/th/all.T          |  2 +-
 4 files changed, 72 insertions(+), 48 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 f6a93f69d893fa343b1bb50e576299f9aeb07f5d


More information about the ghc-commits mailing list