[commit: ghc] wip/T9732: If pattern synonym is bidirectional and its type is some unboxed type T#, generate a worker function of type Void# -> T#, and redirect the wrapper (via a compulsory unfolding) to the worker. Fixes #9732. (06a167b)

git at git.haskell.org git at git.haskell.org
Thu Nov 13 15:13:00 UTC 2014


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

On branch  : wip/T9732
Link       : http://ghc.haskell.org/trac/ghc/changeset/06a167b164e1c2ba58a14e65f4eeff231371bedc/ghc

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

commit 06a167b164e1c2ba58a14e65f4eeff231371bedc
Author: Dr. ERDI Gergo <gergo at erdi.hu>
Date:   Sat Nov 8 18:38:12 2014 +0800

    If pattern synonym is bidirectional and its type is some unboxed type T#,
    generate a worker function of type Void# -> T#, and redirect the wrapper
    (via a compulsory unfolding) to the worker. Fixes #9732.


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

06a167b164e1c2ba58a14e65f4eeff231371bedc
 compiler/basicTypes/PatSyn.lhs                     |  50 +++++++--
 compiler/ghc.mk                                    |   1 +
 compiler/iface/BuildTyCl.lhs                       |   2 +-
 compiler/iface/IfaceSyn.lhs                        |  10 +-
 compiler/iface/MkIface.lhs                         |   4 +-
 compiler/iface/TcIface.lhs                         |  62 +++++++++--
 compiler/typecheck/TcBinds.lhs                     |   8 +-
 compiler/typecheck/TcPatSyn.lhs                    | 119 +++++++++++----------
 compiler/typecheck/TcPatSyn.lhs-boot               |   4 +-
 testsuite/.gitignore                               |   1 +
 testsuite/tests/patsyn/should_compile/T9732.hs     |   4 +
 testsuite/tests/patsyn/should_compile/all.T        |   1 +
 testsuite/tests/patsyn/should_fail/all.T           |   1 +
 .../{unboxed-bind.hs => unboxed-wrapper-naked.hs}  |   6 +-
 .../should_fail/unboxed-wrapper-naked.stderr       |   3 +
 testsuite/tests/patsyn/should_run/all.T            |   2 +
 testsuite/tests/patsyn/should_run/match-unboxed.hs |  21 ++++
 .../should_run/match-unboxed.stdout}               |   2 +
 .../tests/patsyn/should_run/unboxed-wrapper.hs     |   9 ++
 .../should_run/unboxed-wrapper.stdout}             |   0
 20 files changed, 219 insertions(+), 91 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 06a167b164e1c2ba58a14e65f4eeff231371bedc


More information about the ghc-commits mailing list