Skip to content

Commit

Permalink
Merge pull request #21 from PierreR/master
Browse files Browse the repository at this point in the history
Cosmetic: switch case order in spawn to mimic signature
  • Loading branch information
Gabriella439 committed Jan 19, 2014
2 parents 004087b + d678808 commit 6bf07e7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Pipes/Concurrent.hs
Original file line number Diff line number Diff line change
Expand Up @@ -171,19 +171,19 @@ spawn buffer = fmap simplify (spawn' buffer)
-}
spawn' :: Buffer a -> IO (Output a, Input a, STM ())
spawn' buffer = do
(read, write) <- case buffer of
(write, read) <- case buffer of
Bounded n -> do
q <- S.newTBQueueIO n
return (S.readTBQueue q, S.writeTBQueue q)
return (S.writeTBQueue q, S.readTBQueue q)
Unbounded -> do
q <- S.newTQueueIO
return (S.readTQueue q, S.writeTQueue q)
return (S.writeTQueue q, S.readTQueue q)
Single -> do
m <- S.newEmptyTMVarIO
return (S.takeTMVar m, S.putTMVar m)
return (S.putTMVar m, S.takeTMVar m)
Latest a -> do
t <- S.newTVarIO a
return (S.readTVar t, S.writeTVar t)
return (S.writeTVar t, S.readTVar t)

sealed <- S.newTVarIO False
let seal = S.writeTVar sealed True
Expand Down

0 comments on commit 6bf07e7

Please sign in to comment.