stm-conduit 0.2.2 → 0.2.2.1
raw patch · 2 files changed
+17/−13 lines, 2 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Data.Conduit.TMChan: sinkTBMChan :: TBMChan a -> Sink a IO ()
+ Data.Conduit.TMChan: sinkTBMChan :: ResourceIO m => TBMChan a -> Sink a m ()
- Data.Conduit.TMChan: sinkTMChan :: TMChan a -> Sink a IO ()
+ Data.Conduit.TMChan: sinkTMChan :: ResourceIO m => TMChan a -> Sink a m ()
- Data.Conduit.TMChan: sourceTBMChan :: TBMChan a -> Source IO a
+ Data.Conduit.TMChan: sourceTBMChan :: ResourceIO m => TBMChan a -> Source m a
- Data.Conduit.TMChan: sourceTMChan :: TMChan a -> Source IO a
+ Data.Conduit.TMChan: sourceTMChan :: ResourceIO m => TMChan a -> Source m a
Files
- Data/Conduit/TMChan.hs +16/−12
- stm-conduit.cabal +1/−1
Data/Conduit/TMChan.hs view
@@ -52,10 +52,12 @@ import Data.Conduit -chanSource :: chan -- ^ The channel.- -> (chan -> STM (Maybe a)) -- ^ The 'read' function.- -> (chan -> STM ()) -- ^ The 'close' function.- -> Source IO a+chanSource + :: ResourceIO m + => chan -- ^ The channel.+ -> (chan -> STM (Maybe a)) -- ^ The 'read' function.+ -> (chan -> STM ()) -- ^ The 'close' function.+ -> Source m a chanSource ch reader closer = src where src = Source pull close@@ -66,10 +68,12 @@ close = liftIO . atomically $ closer ch {-# INLINE chanSource #-} -chanSink :: chan -- ^ The channel.- -> (chan -> a -> STM ()) -- ^ The 'write' function.- -> (chan -> STM ()) -- ^ The 'close' function.- -> Sink a IO ()+chanSink + :: ResourceIO m+ => chan -- ^ The channel.+ -> (chan -> a -> STM ()) -- ^ The 'write' function.+ -> (chan -> STM ()) -- ^ The 'close' function.+ -> Sink a m () chanSink ch writer closer = sink where sink = SinkData push close@@ -83,14 +87,14 @@ -- channel is closed, the source will close also. -- -- If the channel fills up, the pipeline will stall until values are read.-sourceTBMChan :: TBMChan a -> Source IO a+sourceTBMChan :: ResourceIO m => TBMChan a -> Source m a sourceTBMChan ch = chanSource ch readTBMChan closeTBMChan {-# INLINE sourceTBMChan #-} -- | A simple wrapper around a TMChan. As data is pushed into the channel, the -- source will read it and pass it down the conduit pipeline. When the -- channel is closed, the source will close also.-sourceTMChan :: TMChan a -> Source IO a+sourceTMChan :: ResourceIO m => TMChan a -> Source m a sourceTMChan ch = chanSource ch readTMChan closeTMChan {-# INLINE sourceTMChan #-} @@ -98,13 +102,13 @@ -- will magically begin to appear in the channel. If the channel is full, -- the sink will block until space frees up. When the sink is closed, the -- channel will close too.-sinkTBMChan :: TBMChan a -> Sink a IO ()+sinkTBMChan :: ResourceIO m => TBMChan a -> Sink a m () sinkTBMChan ch = chanSink ch writeTBMChan closeTBMChan {-# INLINE sinkTBMChan #-} -- | A simple wrapper around a TMChan. As data is pushed into this sink, it -- will magically begin to appear in the channel. When the sink is closed, -- the channel will close too.-sinkTMChan :: TMChan a -> Sink a IO ()+sinkTMChan :: ResourceIO m => TMChan a -> Sink a m () sinkTMChan ch = chanSink ch writeTMChan closeTMChan {-# INLINE sinkTMChan #-}
stm-conduit.cabal view
@@ -1,5 +1,5 @@ Name: stm-conduit-Version: 0.2.2+Version: 0.2.2.1 Synopsis: Introduces conduits to channels, and promotes using conduits concurrently. Description: Provides two simple conduit wrappers around STM