concurrent-supply 0.1.1 → 0.1.2
raw patch · 3 files changed
+9/−1 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- .travis.yml +1/−0
- Control/Concurrent/Supply.hs +5/−0
- concurrent-supply.cabal +3/−1
+ .travis.yml view
@@ -0,0 +1,1 @@+language: haskell
Control/Concurrent/Supply.hs view
@@ -69,6 +69,7 @@ blockCounter :: IORef Int blockCounter = unsafeDupablePerformIO $ newIORef 0+{-# NOINLINE blockCounter #-} gen :: () -> Block gen _ = Block (unsafeDupablePerformIO $ atomicModifyIORef blockCounter $ \ i -> let i' = i + blockSize in (i', i))@@ -92,22 +93,26 @@ blockSupply :: Block -> Supply blockSupply (Block i bs) = Supply i (i + blockSize - 1) (extract bs)+{-# INLINE blockSupply #-} -- | Grab a new supply. Any two supplies obtained with newSupply are guaranteed to return -- disjoint sets of identifiers. Replaying the same sequence of operations on the same -- Supply will yield the same results. newSupply :: IO Supply newSupply = blockSupply <$> newBlock+{-# INLINE newSupply #-} -- | Obtain a fresh Id from a Supply. freshId :: Supply -> (Int, Supply) freshId s = case freshId# s of (# i, s' #) -> (I# i, s')+{-# INLINE freshId #-} -- | Split a supply into two supplies that will return disjoint identifiers splitSupply :: Supply -> (Supply, Supply) splitSupply s = case splitSupply# s of (# l, r #) -> (l, r)+{-# INLINE splitSupply #-} -- | An unboxed version of freshId freshId# :: Supply -> (# Int#, Supply #)
concurrent-supply.cabal view
@@ -1,6 +1,6 @@ name: concurrent-supply category: Concurrency, Parallelism-version: 0.1.1+version: 0.1.2 license: BSD3 cabal-version: >= 1.10 license-file: LICENSE@@ -8,10 +8,12 @@ maintainer: Edward A. Kmett <ekmett@gmail.com> stability: experimental homepage: http://github.com/ekmett/concurrent-supply/+bug-reports: http://github.com/ekmett/concurrent-supply/issues copyright: Copyright (C) 2011 Edward A. Kmett synopsis: A fast concurrent unique identifier supply with a pure API description: A fast concurrent unique identifier supply with a pure API build-type: Simple+extra-source-files: .travis.yml source-repository head type: git