[commit: ghc] ghc-8.0: TemplateHaskell: revive isStrict, notStrict and unpacked (b8d32e2)
git at git.haskell.org
git at git.haskell.org
Wed Jan 13 19:34:17 UTC 2016
Repository : ssh://git@git.haskell.org/ghc
On branch : ghc-8.0
Link : http://ghc.haskell.org/trac/ghc/changeset/b8d32e2f620d4f70bc3fffb791676b3a56ca26bd/ghc
>---------------------------------------------------------------
commit b8d32e2f620d4f70bc3fffb791676b3a56ca26bd
Author: Thomas Miedema <thomasmiedema at gmail.com>
Date: Wed Jan 13 14:45:21 2016 +0100
TemplateHaskell: revive isStrict, notStrict and unpacked
These 3 functions are useful to keep around a bit longer, to prevent
breaking existing code that uses them.
Related to #10697.
Reviewers: austin, goldfire, RyanGlScott, bgamari
Reviewed By: RyanGlScott, bgamari
Differential Revision: https://phabricator.haskell.org/D1761
(cherry picked from commit d44bc5c061e3f0ba459f835aba683c0366187b74)
>---------------------------------------------------------------
b8d32e2f620d4f70bc3fffb791676b3a56ca26bd
libraries/template-haskell/Language/Haskell/TH.hs | 1 +
libraries/template-haskell/Language/Haskell/TH/Lib.hs | 14 ++++++++++++++
2 files changed, 15 insertions(+)
diff --git a/libraries/template-haskell/Language/Haskell/TH.hs b/libraries/template-haskell/Language/Haskell/TH.hs
index 1988286..2f750e3 100644
--- a/libraries/template-haskell/Language/Haskell/TH.hs
+++ b/libraries/template-haskell/Language/Haskell/TH.hs
@@ -125,6 +125,7 @@ module Language.Haskell.TH(
-- **** Strictness
noSourceUnpackedness, sourceNoUnpack, sourceUnpack,
noSourceStrictness, sourceLazy, sourceStrict,
+ isStrict, notStrict, unpacked,
bang, bangType, varBangType, strictType, varStrictType,
-- **** Class Contexts
cxt, classP, equalP,
diff --git a/libraries/template-haskell/Language/Haskell/TH/Lib.hs b/libraries/template-haskell/Language/Haskell/TH/Lib.hs
index 9f75b45..7499c8a 100644
--- a/libraries/template-haskell/Language/Haskell/TH/Lib.hs
+++ b/libraries/template-haskell/Language/Haskell/TH/Lib.hs
@@ -656,6 +656,20 @@ noSourceStrictness = return NoSourceStrictness
sourceLazy = return SourceLazy
sourceStrict = return SourceStrict
+{-# DEPRECATED isStrict
+ ["Use 'bang'. See https://ghc.haskell.org/trac/ghc/wiki/Migration/8.0. ",
+ "Example usage: 'bang noSourceUnpackedness sourceStrict'"] #-}
+{-# DEPRECATED notStrict
+ ["Use 'bang'. See https://ghc.haskell.org/trac/ghc/wiki/Migration/8.0. ",
+ "Example usage: 'bang noSourceUnpackedness noSourceStrictness'"] #-}
+{-# DEPRECATED unpacked
+ ["Use 'bang'. See https://ghc.haskell.org/trac/ghc/wiki/Migration/8.0. ",
+ "Example usage: 'bang sourceUnpack sourceStrict'"] #-}
+isStrict, notStrict, unpacked :: Q Strict
+isStrict = bang noSourceUnpackedness sourceStrict
+notStrict = bang noSourceUnpackedness noSourceStrictness
+unpacked = bang sourceUnpack sourceStrict
+
bang :: SourceUnpackednessQ -> SourceStrictnessQ -> BangQ
bang u s = do u' <- u
s' <- s
More information about the ghc-commits
mailing list