File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ module Control.Concurrent.STM.TSem
2727import Control.Concurrent.STM
2828import Control.Monad
2929import Data.Typeable
30- import Data.Word as Word
30+ import Numeric.Natural
3131
3232-- | 'TSem' is a transactional semaphore. It holds a certain number
3333-- of units, and units may be acquired or released by 'waitTSem' and
@@ -56,8 +56,8 @@ newtype TSem = TSem (TVar Integer)
5656-- operations to counter-balance.
5757--
5858-- @since 2.4.2
59- newTSem :: Int -> STM TSem
60- newTSem i = fmap TSem (newTVar $! toInteger i)
59+ newTSem :: Integer -> STM TSem
60+ newTSem i = fmap TSem (newTVar $! i)
6161
6262-- NOTE: we can't expose a good `TSem -> STM Int' operation as blocked
6363-- 'waitTSem' aren't reliably reflected in a negative counter value.
@@ -99,7 +99,7 @@ signalTSem (TSem t) = do
9999-- > signalTSem == signalTSemN 1
100100--
101101-- @since 2.4.5
102- signalTSemN :: Word. Word -> TSem -> STM ()
102+ signalTSemN :: Natural -> TSem -> STM ()
103103signalTSemN 0 _ = return ()
104104signalTSemN 1 s = signalTSem s
105105signalTSemN n (TSem t) = do
Original file line number Diff line number Diff line change 88
99 * Switched ` newTBQueue ` and ` newTBQueueIO ` to accept ` Natural ` as size (gh-17 )
1010
11+ * Switched ` signalTSemN ` and ` newTSem ` to accept ` Natural ` and ` Integer ` respectively (gh-17 )
12+
1113----
1214
1315#### 2.4.5.1 * Sep 2018*
You can’t perform that action at this time.
0 commit comments