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

git at git.haskell.org git at git.haskell.org
Tue Nov 4 01:29:51 UTC 2014


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

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

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

commit e08b457f470aa74322ff9af70fb26f55d81b2481
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.


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

e08b457f470aa74322ff9af70fb26f55d81b2481
 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 e08b457f470aa74322ff9af70fb26f55d81b2481


More information about the ghc-commits mailing list