Skip to content

Commit f1ae7dc

Browse files
committed
Minor refactoring to silence warnings
1 parent ee84fe2 commit f1ae7dc

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

Control/Concurrent/STM/TBQueue.hs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
{-# OPTIONS_GHC -fno-warn-name-shadowing #-}
2-
{-# LANGUAGE CPP, DeriveDataTypeable #-}
1+
{-# LANGUAGE CPP #-}
2+
{-# LANGUAGE DeriveDataTypeable #-}
33

44
#if __GLASGOW_HASKELL__ >= 701
5-
{-# LANGUAGE Trustworthy #-}
5+
{-# LANGUAGE Trustworthy #-}
66
#endif
77

88
-----------------------------------------------------------------------------
@@ -44,21 +44,21 @@ module Control.Concurrent.STM.TBQueue (
4444
isFullTBQueue,
4545
) where
4646

47-
import Data.Typeable
48-
import Numeric.Natural
49-
import GHC.Conc
50-
51-
#define _UPK_(x) {-# UNPACK #-} !(x)
47+
import Data.Typeable (Typeable)
48+
import GHC.Conc (STM, TVar, newTVar, newTVarIO, orElse,
49+
readTVar, retry, writeTVar)
50+
import Numeric.Natural (Natural)
51+
import Prelude hiding (read)
5252

5353
-- | 'TBQueue' is an abstract type representing a bounded FIFO channel.
5454
--
5555
-- @since 2.4
5656
data TBQueue a
57-
= TBQueue _UPK_(TVar Natural) -- CR: read capacity
58-
_UPK_(TVar [a]) -- R: elements waiting to be read
59-
_UPK_(TVar Natural) -- CW: write capacity
60-
_UPK_(TVar [a]) -- W: elements written (head is most recent)
61-
_UPK_(Natural) -- CAP: initial capacity
57+
= TBQueue {-# UNPACK #-} !(TVar Natural) -- CR: read capacity
58+
{-# UNPACK #-} !(TVar [a]) -- R: elements waiting to be read
59+
{-# UNPACK #-} !(TVar Natural) -- CW: write capacity
60+
{-# UNPACK #-} !(TVar [a]) -- W: elements written (head is most recent)
61+
!(Natural) -- CAP: initial capacity
6262
deriving Typeable
6363

6464
instance Eq (TBQueue a) where

0 commit comments

Comments
 (0)