Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
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...
commit d2266fd097ee9e2de0efbc3688f66b3a81b4a9d9 1 parent 939ac89
@pcapriotti authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 Control/Pipe/Binary.hs
View
4 Control/Pipe/Binary.hs
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.