[commit: ghc] master: make QSem and QSemN newtypes (f5e98bb)
git at git.haskell.org
git at git.haskell.org
Tue Dec 18 04:37:38 UTC 2018
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/f5e98bb31cf4dae740c8dc598ef207aa79d5a179/ghc
>---------------------------------------------------------------
commit f5e98bb31cf4dae740c8dc598ef207aa79d5a179
Author: chessai <chessai1996 at gmail.com>
Date: Mon Dec 17 23:36:20 2018 -0500
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
>---------------------------------------------------------------
f5e98bb31cf4dae740c8dc598ef207aa79d5a179
libraries/base/Control/Concurrent/QSem.hs | 3 +--
libraries/base/Control/Concurrent/QSemN.hs | 4 +---
2 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/libraries/base/Control/Concurrent/QSem.hs b/libraries/base/Control/Concurrent/QSem.hs
index ea39625..133d6e2 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 b8c9274..8b3ce55 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):
--
More information about the ghc-commits
mailing list