[commit: ghc] master: Allow ($) to return an unlifted type (Trac #8739) (5dd1cbb)
git at git.haskell.org
git at git.haskell.org
Tue Feb 18 08:46:39 UTC 2014
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/5dd1cbbfc0a19e92d7eeff6f328abc7558992fd6/ghc
>---------------------------------------------------------------
commit 5dd1cbbfc0a19e92d7eeff6f328abc7558992fd6
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).
>---------------------------------------------------------------
5dd1cbbfc0a19e92d7eeff6f328abc7558992fd6
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 5dd1cbbfc0a19e92d7eeff6f328abc7558992fd6
More information about the ghc-commits
mailing list