[commit: ghc] ghc-7.8: Allow ($) to return an unlifted type (Trac #8739) (a455437)

git at git.haskell.org git at git.haskell.org
Wed Feb 19 14:00:41 UTC 2014


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

On branch  : ghc-7.8
Link       : http://ghc.haskell.org/trac/ghc/changeset/a455437980c6f6a96190ac97b7757f4399376f63/ghc

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

commit a455437980c6f6a96190ac97b7757f4399376f63
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Tue Feb 18 08:46:14 2014 +0000

    Allow ($) to return an unlifted type (Trac #8739)
    
    Since ($) simply returns its result, via a tail call, it can
    perfectly well have an unlifted result type; e.g.
        foo $ True    where  foo :: Bool -> Int#
    should be perfectly fine.
    
    This used to work in GHC 7.2, but caused a Lint failure.  This patch
    makes it work again (which involved removing code in TcExpr), but fixing
    the Lint failure meant I had to make ($) into a wired-in Id.  Which
    is not hard to do (in MkId).
    
    (cherry picked from commit 5dd1cbbfc0a19e92d7eeff6f328abc7558992fd6)


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

a455437980c6f6a96190ac97b7757f4399376f63
 compiler/basicTypes/MkId.lhs                       |   50 +++++++++++++++-----
 compiler/prelude/PrelNames.lhs                     |    5 +-
 compiler/typecheck/TcExpr.lhs                      |   17 +++----
 testsuite/tests/typecheck/should_compile/T8739.hs  |   10 ++++
 testsuite/tests/typecheck/should_fail/T7857.stderr |    2 +-
 testsuite/tests/typecheck/should_run/T8739.hs      |   10 ++++
 .../should_run/T8739.stdout}                       |    0
 testsuite/tests/typecheck/should_run/all.T         |    1 +
 8 files changed, 70 insertions(+), 25 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 a455437980c6f6a96190ac97b7757f4399376f63


More information about the ghc-commits mailing list