summaryrefslogtreecommitdiff
path: root/libraries/base
diff options
context:
space:
mode:
authorchessai <chessai1996@gmail.com>2018-12-17 23:36:20 -0500
committerBen Gamari <ben@smart-cactus.org>2018-12-17 23:36:53 -0500
commitf5e98bb31cf4dae740c8dc598ef207aa79d5a179 (patch)
tree5e4c2def51e459f43805a951d1a68c170002d450 /libraries/base
parenta0fb20bae31ed7a50d1a6e4e15c42ba25d836bfc (diff)
downloadhaskell-f5e98bb31cf4dae740c8dc598ef207aa79d5a179.tar.gz
make QSem and QSemN newtypes
Reviewers: RyanGlScott, ekmett, hvr, bgamari Reviewed By: bgamari Subscribers: rwbarton, carter GHC Trac Issues: #15995 Differential Revision: https://phabricator.haskell.org/D5456
Diffstat (limited to 'libraries/base')
-rw-r--r--libraries/base/Control/Concurrent/QSem.hs3
-rw-r--r--libraries/base/Control/Concurrent/QSemN.hs4
2 files changed, 2 insertions, 5 deletions
diff --git a/libraries/base/Control/Concurrent/QSem.hs b/libraries/base/Control/Concurrent/QSem.hs
index ea396255a4..133d6e2ab8 100644
--- a/libraries/base/Control/Concurrent/QSem.hs
+++ b/libraries/base/Control/Concurrent/QSem.hs
@@ -1,6 +1,5 @@
{-# LANGUAGE Safe #-}
{-# LANGUAGE BangPatterns #-}
-{-# OPTIONS_GHC -funbox-strict-fields #-}
-----------------------------------------------------------------------------
-- |
@@ -39,7 +38,7 @@ import Data.Maybe
--
-- is safe; it never loses a unit of the resource.
--
-data QSem = QSem !(MVar (Int, [MVar ()], [MVar ()]))
+newtype QSem = QSem (MVar (Int, [MVar ()], [MVar ()]))
-- The semaphore state (i, xs, ys):
--
diff --git a/libraries/base/Control/Concurrent/QSemN.hs b/libraries/base/Control/Concurrent/QSemN.hs
index b8c9274057..8b3ce5526e 100644
--- a/libraries/base/Control/Concurrent/QSemN.hs
+++ b/libraries/base/Control/Concurrent/QSemN.hs
@@ -1,6 +1,4 @@
{-# LANGUAGE Safe #-}
-{-# LANGUAGE BangPatterns #-}
-{-# OPTIONS_GHC -funbox-strict-fields #-}
-----------------------------------------------------------------------------
-- |
@@ -41,7 +39,7 @@ import Data.Maybe
--
-- is safe; it never loses any of the resource.
--
-data QSemN = QSemN !(MVar (Int, [(Int, MVar ())], [(Int, MVar ())]))
+newtype QSemN = QSemN (MVar (Int, [(Int, MVar ())], [(Int, MVar ())]))
-- The semaphore state (i, xs, ys):
--