[commit: ghc] master: TemplateHaskell: revive isStrict, notStrict and unpacked (d44bc5c)

git at git.haskell.org git at git.haskell.org
Wed Jan 13 14:22:24 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/d44bc5c061e3f0ba459f835aba683c0366187b74/ghc

>---------------------------------------------------------------

commit d44bc5c061e3f0ba459f835aba683c0366187b74
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


>---------------------------------------------------------------

d44bc5c061e3f0ba459f835aba683c0366187b74
 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 a024864..81ef1fc 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