Implement the Strict language extension
authorAdam Sandberg Eriksson <adam@sandbergericsson.se>
Sat, 14 Nov 2015 21:06:16 +0000 (22:06 +0100)
committerBen Gamari <ben@smart-cactus.org>
Sat, 14 Nov 2015 21:06:29 +0000 (22:06 +0100)
commit46a03fbec6a02761db079d1746532565f34c340f
tree04dfc1739f2e0612b3be99049d6f4202a5e53d0a
parent54884220cd8f68bcb4291cc3689d69258b835f6f
Implement the Strict language extension

Add a new language extension `-XStrict` which turns all bindings strict
as if the programmer had written a `!` before it. This also upgrades
ordinary Haskell to allow recursive and polymorphic strict bindings.

See the wiki[1] and the Note [Desugar Strict binds] in DsBinds for
specification and implementation details.

[1] https://ghc.haskell.org/trac/ghc/wiki/StrictPragma

Reviewers: austin, tibbe, simonpj, bgamari

Reviewed By: tibbe, bgamari

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D1142

GHC Trac Issues: #8347
26 files changed:
compiler/deSugar/DsBinds.hs
compiler/deSugar/DsExpr.hs
compiler/deSugar/DsUtils.hs
compiler/deSugar/Match.hs
compiler/hsSyn/HsPat.hs
compiler/main/DynFlags.hs
compiler/typecheck/TcBinds.hs
docs/users_guide/glasgow_exts.rst
testsuite/tests/deSugar/should_compile/DsStrictWarn.hs [new file with mode: 0644]
testsuite/tests/deSugar/should_compile/DsStrictWarn.stderr [new file with mode: 0644]
testsuite/tests/deSugar/should_compile/T5455.hs
testsuite/tests/deSugar/should_compile/all.T
testsuite/tests/deSugar/should_fail/DsStrictFail.hs [new file with mode: 0644]
testsuite/tests/deSugar/should_fail/DsStrictFail.stderr [new file with mode: 0644]
testsuite/tests/deSugar/should_fail/Makefile [new file with mode: 0644]
testsuite/tests/deSugar/should_fail/all.T [new file with mode: 0644]
testsuite/tests/deSugar/should_run/DsStrict.hs [new file with mode: 0644]
testsuite/tests/deSugar/should_run/DsStrict.stderr [new file with mode: 0644]
testsuite/tests/deSugar/should_run/DsStrict.stdout [new file with mode: 0644]
testsuite/tests/deSugar/should_run/DsStrictLet.hs [new file with mode: 0644]
testsuite/tests/deSugar/should_run/DsStrictLet.stderr [new file with mode: 0644]
testsuite/tests/deSugar/should_run/all.T
testsuite/tests/driver/T4437.hs
testsuite/tests/ghci/scripts/T9140.script
testsuite/tests/ghci/scripts/T9140.stdout
testsuite/tests/typecheck/should_fail/T6078.stderr