packages feed

concurrent-machines 0.3.0 → 0.3.1

raw patch · 2 files changed

+4/−2 lines, 2 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

concurrent-machines.cabal view
@@ -1,5 +1,5 @@ name:                concurrent-machines-version:             0.3.0+version:             0.3.1 synopsis:            Concurrent networked stream transducers  description: A simple use-case for this library is to run the stages
src/Data/Machine/Concurrent/Fanout.hs view
@@ -6,7 +6,7 @@ import Control.Concurrent.Async.Lifted (Async, async, wait) import Control.Monad (foldM) import Control.Monad.Trans.Control (MonadBaseControl, StM)-import Data.Machine (Step(..), MachineT(..), encased, ProcessT, Is(..))+import Data.Machine (Step(..), MachineT(..), encased, stopped, ProcessT, Is(..)) import Data.Machine.Concurrent.AsyncStep (MachineStep) import Data.Maybe (catMaybes) #if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ < 710@@ -53,6 +53,7 @@ -- a single yield from the composite process. fanout :: (MonadBaseControl IO m, Semigroup r)        => [ProcessT m a r] -> ProcessT m a r+fanout [] = stopped fanout xs = encased $ Await (MachineT . aux) Refl (fanout xs)   where aux y = do (rs,xs') <- mapM (feed y) xs >>= mapAccumLM yields []                    let nxt = fanout $ catMaybes xs'@@ -72,6 +73,7 @@ -- followed by a 'taking' process. fanoutSteps :: (MonadBaseControl IO m, Monoid r)             => [ProcessT m a r] -> ProcessT m a r+fanoutSteps [] = stopped fanoutSteps xs = encased $ Await (MachineT . aux) Refl (fanoutSteps xs)   where aux y = do (rs,xs') <- mapM (feed y) xs >>= mapAccumLM yields []                    let nxt = fanoutSteps $ catMaybes xs'