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 5dd1cbbf)
Showing
- compiler/basicTypes/MkId.lhs 38 additions, 12 deletionscompiler/basicTypes/MkId.lhs
- compiler/prelude/PrelNames.lhs 1 addition, 4 deletionscompiler/prelude/PrelNames.lhs
- compiler/typecheck/TcExpr.lhs 9 additions, 8 deletionscompiler/typecheck/TcExpr.lhs
- testsuite/tests/typecheck/should_compile/T8739.hs 10 additions, 0 deletionstestsuite/tests/typecheck/should_compile/T8739.hs
- testsuite/tests/typecheck/should_fail/T7857.stderr 1 addition, 1 deletiontestsuite/tests/typecheck/should_fail/T7857.stderr
- testsuite/tests/typecheck/should_run/T8739.hs 10 additions, 0 deletionstestsuite/tests/typecheck/should_run/T8739.hs
- testsuite/tests/typecheck/should_run/T8739.stdout 1 addition, 0 deletionstestsuite/tests/typecheck/should_run/T8739.stdout
- testsuite/tests/typecheck/should_run/all.T 1 addition, 0 deletionstestsuite/tests/typecheck/should_run/all.T
Loading
Please register or sign in to comment