broadcast-chan 0.2.1 → 0.2.1.1
raw patch · 7 files changed
+13/−43 lines, 7 filesdep −bifunctorsdep ~basedep ~unliftio-corePVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependencies removed: bifunctors
Dependency ranges changed: base, unliftio-core
API changes (from Hackage documentation)
- BroadcastChan: type In = 'In
+ BroadcastChan: type In = 'In
- BroadcastChan: type Out = 'Out
+ BroadcastChan: type Out = 'Out
- BroadcastChan.Throw: type In = 'In
+ BroadcastChan.Throw: type In = 'In
- BroadcastChan.Throw: type Out = 'Out
+ BroadcastChan.Throw: type Out = 'Out
Files
- BroadcastChan.hs +2/−1
- BroadcastChan/Extra.hs +0/−4
- BroadcastChan/Internal.hs +0/−14
- CHANGELOG.md +4/−0
- benchmarks/Channels.hs +0/−5
- benchmarks/Sync.hs +1/−7
- broadcast-chan.cabal +6/−12
BroadcastChan.hs view
@@ -83,7 +83,8 @@ import Control.Exception (SomeException(..), mask, throwIO, try, uninterruptibleMask_) import Control.Monad (liftM)-import Control.Monad.IO.Unlift (MonadUnliftIO(..), UnliftIO(..))+import Control.Monad.IO.Unlift+ (MonadUnliftIO, UnliftIO(..), askUnliftIO, withRunInIO) import Data.Foldable as F (Foldable(..), foldlM, forM_) import BroadcastChan.Extra
BroadcastChan/Extra.hs view
@@ -1,5 +1,4 @@ {-# OPTIONS_HADDOCK not-home #-}-{-# LANGUAGE CPP #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE ScopedTypeVariables #-}@@ -33,9 +32,6 @@ , runParallelWith_ ) where -#if !MIN_VERSION_base(4,8,0)-import Control.Applicative ((<*))-#endif import Control.Concurrent (ThreadId, forkFinally, mkWeakThreadId, myThreadId) import Control.Concurrent.MVar import Control.Concurrent.QSem
BroadcastChan/Internal.hs view
@@ -1,12 +1,8 @@-{-# LANGUAGE CPP #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE Trustworthy #-} module BroadcastChan.Internal where -#if !MIN_VERSION_base(4,8,0)-import Control.Applicative ((<*))-#endif import Control.Concurrent.MVar import Control.Exception (mask_) import Control.Monad ((>=>))@@ -67,19 +63,9 @@ -- @True@ indicates the channel is both closed and empty, meaning reads -- will always fail. isClosedBChan :: MonadIO m => BroadcastChan dir a -> m Bool-#if MIN_VERSION_base(4,7,0) isClosedBChan (BChan mvar) = liftIO $ do old_hole <- readMVar mvar val <- tryReadMVar old_hole-#else-isClosedBChan (BChan mvar) = liftIO . mask_ $ do- old_hole <- takeMVar mvar- val <- tryTakeMVar old_hole- case val of- Just x -> putMVar old_hole x- Nothing -> return ()- putMVar mvar old_hole-#endif case val of Just Closed -> return True _ -> return False
CHANGELOG.md view
@@ -1,3 +1,7 @@+0.2.1.1 [2020.03.05]+--------------------+* Updated imports to support `unliftio-core` 0.2.x+ 0.2.1 [2019.11.17] ------------------ * Adds `ThreadBracket`, `runParallelWith`, and `runParallelWith_` to
benchmarks/Channels.hs view
@@ -1,15 +1,10 @@ {-# LANGUAGE BangPatterns #-}-{-# LANGUAGE CPP #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE RecordWildCards #-} import Criterion.Main import Control.Applicative ((<$>))-#if __GLASGOW_HASKELL__ > 704 import Control.Concurrent (setNumCapabilities)-#else-import GHC.Conc (setNumCapabilities)-#endif import Control.Concurrent.Async import BroadcastChan import qualified BroadcastChan.Throw as Throw
benchmarks/Sync.hs view
@@ -1,14 +1,7 @@ {-# LANGUAGE BangPatterns #-}-{-# LANGUAGE CPP #-} import Criterion.Main -#if __GLASGOW_HASKELL__ > 704 import Control.Concurrent (forkIO, setNumCapabilities, yield)-import GHC.Conc (getNumProcessors)-#else-import Control.Concurrent (forkIO, yield)-import GHC.Conc (getNumProcessors, setNumCapabilities)-#endif import Control.Concurrent.Async (async) import qualified Control.Concurrent.Async as Async import Control.Concurrent.Chan@@ -22,6 +15,7 @@ import Data.Atomics.Counter import Data.IORef import Data.Function ((&))+import GHC.Conc (getNumProcessors) instance NFData (IO a) where rnf !_ = ()
broadcast-chan.cabal view
@@ -1,5 +1,5 @@ Name: broadcast-chan-Version: 0.2.1+Version: 0.2.1.1 Homepage: https://github.com/merijn/broadcast-chan Bug-Reports: https://github.com/merijn/broadcast-chan/issues@@ -14,8 +14,8 @@ Category: System Cabal-Version: >= 1.10 Build-Type: Simple-Tested-With: GHC == 7.8.4, GHC == 7.10.3, GHC == 8.0.2, GHC == 8.2.2,- GHC == 8.4.4, GHC == 8.6.5, GHC == 8.8.1+Tested-With: GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.4, GHC == 8.6.5,+ GHC == 8.8.3, GHC == 8.10.1 Extra-Source-Files: README.md , CHANGELOG.md@@ -91,8 +91,7 @@ BroadcastChan.Throw Other-Modules: BroadcastChan.Internal - Other-Extensions: CPP- DataKinds+ Other-Extensions: DataKinds DeriveDataTypeable KindSignatures NamedFieldPuns@@ -101,9 +100,9 @@ Trustworthy TupleSections - Build-Depends: base >= 4.7 && < 4.14+ Build-Depends: base >= 4.7 && < 4.15 , transformers >= 0.2 && < 0.6- , unliftio-core >= 0.1.1 && < 0.2+ , unliftio-core >= 0.1.1 && < 0.3 Benchmark sync Default-Language: Haskell2010@@ -115,7 +114,6 @@ Hs-Source-Dirs: benchmarks Other-Extensions: BangPatterns- CPP if flag(sync) Buildable: True@@ -141,7 +139,6 @@ Hs-Source-Dirs: benchmarks Other-Extensions: BangPatterns- CPP DeriveGeneric RecordWildCards @@ -151,9 +148,6 @@ , criterion >= 1.2 && < 1.6 , deepseq >= 1.1 && < 1.5 , stm >= 2.4 && < 2.6-- if impl(ghc < 7.10)- Build-Depends: bifunctors >= 0.1 && < 5.6 Benchmark utilities Default-Language: Haskell2010