Permalink
Browse files

Make fileWriter more polymorphic.

Since fileWriter is an infinite consumer, there is no reason why it
shouldn't be polymorphic in the return value.
  • Loading branch information...
pcapriotti committed Jun 2, 2012
1 parent 939ac89 commit d2266fd097ee9e2de0efbc3688f66b3a81b4a9d9
Showing with 2 additions and 2 deletions.
  1. +2 −2 Control/Pipe/Binary.hs
View
@@ -48,7 +48,7 @@ handleReader h = go
-- | Write data to a file.
--
-- The file is only opened if some data arrives into the pipe.
-fileWriter :: MonadIO m => FilePath -> Pipe B.ByteString Void m ()
+fileWriter :: MonadIO m => FilePath -> Pipe B.ByteString Void m r
fileWriter path = do
-- receive some data before opening the handle
input <- await
@@ -61,7 +61,7 @@ fileWriter path = do
handleWriter
-- | Write data to a handle.
-handleWriter:: MonadIO m => Handle -> Pipe B.ByteString Void m ()
+handleWriter:: MonadIO m => Handle -> Pipe B.ByteString Void m r
handleWriter h = forever $ do
chunk <- await
lift . liftIO . B.hPut h $ chunk

0 comments on commit d2266fd

Please sign in to comment.