diff options
author | Adam Sandberg Eriksson <adam@sandbergericsson.se> | 2015-11-14 22:06:16 +0100 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2015-11-14 22:06:29 +0100 |
commit | 46a03fbec6a02761db079d1746532565f34c340f (patch) | |
tree | 04dfc1739f2e0612b3be99049d6f4202a5e53d0a /testsuite/tests/deSugar/should_compile/DsStrictWarn.hs | |
parent | 54884220cd8f68bcb4291cc3689d69258b835f6f (diff) | |
download | haskell-46a03fbec6a02761db079d1746532565f34c340f.tar.gz |
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
Diffstat (limited to 'testsuite/tests/deSugar/should_compile/DsStrictWarn.hs')
-rw-r--r-- | testsuite/tests/deSugar/should_compile/DsStrictWarn.hs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/testsuite/tests/deSugar/should_compile/DsStrictWarn.hs b/testsuite/tests/deSugar/should_compile/DsStrictWarn.hs new file mode 100644 index 0000000000..81b337d05b --- /dev/null +++ b/testsuite/tests/deSugar/should_compile/DsStrictWarn.hs @@ -0,0 +1,7 @@ +{-# OPTIONS_GHC -fwarn-incomplete-uni-patterns #-} +{-# LANGUAGE Strict #-} +module DsStrictWarn where + +-- should warn about non-exhaustive pattern match +w :: String -> String +w x = let (_:_) = x in "1" |