From f5e98bb31cf4dae740c8dc598ef207aa79d5a179 Mon Sep 17 00:00:00 2001 From: chessai Date: Mon, 17 Dec 2018 23:36:20 -0500 Subject: 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 --- libraries/base/Control/Concurrent/QSem.hs | 3 +-- libraries/base/Control/Concurrent/QSemN.hs | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-) (limited to 'libraries/base') 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): -- -- cgit v1.2.1