[commit: ghc] master: base: Deprecate STM invariant checking primitives (e5d0101)

git at git.haskell.org git at git.haskell.org
Sun Feb 4 01:36:00 UTC 2018


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

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

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

commit e5d0101121cf4ce4dffe59025360096ee57c5372
Author: Ben Gamari <ben at smart-cactus.org>
Date:   Sat Feb 3 13:11:17 2018 -0500

    base: Deprecate STM invariant checking primitives


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

e5d0101121cf4ce4dffe59025360096ee57c5372
 libraries/base/GHC/Conc/Sync.hs | 12 ++++++++++++
 libraries/base/changelog.md     |  3 +++
 2 files changed, 15 insertions(+)

diff --git a/libraries/base/GHC/Conc/Sync.hs b/libraries/base/GHC/Conc/Sync.hs
index de77792..0bd2900 100644
--- a/libraries/base/GHC/Conc/Sync.hs
+++ b/libraries/base/GHC/Conc/Sync.hs
@@ -782,6 +782,18 @@ catchSTM (STM m) handler = STM $ catchSTM# m handler'
                      Just e' -> unSTM (handler e')
                      Nothing -> raiseIO# e
 
+-- Invariant checking has been removed. See #14324 and
+-- https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0011-deprecate-stm-invariants.rst
+{-# DEPRECATED checkInv, always, alwaysSucceeds
+    [ "The STM invariant-checking mechanism is deprecated in GHC 8.4"
+    , "and will be removed in GHC 8.10. See "
+    , "<https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0011-deprecate-stm-invariants.rst>."
+    , ""
+    , "Existing users are encouraged to encapsulate their STM"
+    , "operations in safe abstractions which can perform the invariant"
+    , "checking without help from the runtime system."
+    ] #-}
+
 -- | Low-level primitive on which 'always' and 'alwaysSucceeds' are built.
 -- 'checkInv' differs from these in that,
 --
diff --git a/libraries/base/changelog.md b/libraries/base/changelog.md
index fdeb7de..ad8767f 100644
--- a/libraries/base/changelog.md
+++ b/libraries/base/changelog.md
@@ -76,6 +76,9 @@
 
   * `getExecutablePath` now resolves symlinks on Windows (#14483)
 
+  * Deprecated STM invariant checking primitives (`checkInv`, `always`, and
+    `alwaysSucceeds`) in `GHC.Conc.Sync` (#14324).
+
 ## 4.10.1.0 *November 2017*
   * Bundled with GHC 8.2.2
 



More information about the ghc-commits mailing list