io-streams 1.3.3.1 → 1.3.4.0
raw patch · 3 files changed
+29/−1 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ System.IO.Streams.Handle: handleToStreams :: Handle -> IO (InputStream ByteString, OutputStream ByteString)
Files
- changelog.md +4/−0
- io-streams.cabal +1/−1
- src/System/IO/Streams/Handle.hs +24/−0
changelog.md view
@@ -1,3 +1,7 @@+# Version 1.3.4.0+Added `System.IO.Streams.Handle.handleToStreams`, to conveniently+create an `InputStream`/`OutputStream` pair.+ # Version 1.3.3.1 - Fixed a testsuite compile error on GHC >= 7.10.
io-streams.cabal view
@@ -1,5 +1,5 @@ Name: io-streams-Version: 1.3.3.1+Version: 1.3.4.0 License: BSD3 License-file: LICENSE Category: Data, Network, IO-Streams
src/System/IO/Streams/Handle.hs view
@@ -10,6 +10,7 @@ ( -- * Handle conversions handleToInputStream , handleToOutputStream+ , handleToStreams , inputStreamToHandle , outputStreamToHandle , streamPairToHandle@@ -68,6 +69,29 @@ f (Just x) = if S.null x then hFlush h else S.hPut h x+++------------------------------------------------------------------------------+-- | Converts a readable and writable handle into an 'InputStream'/'OutputStream'+-- of strict 'ByteString's.+--+-- Note that the wrapped handle is /not/ closed when it receives+-- end-of-stream; you can use+-- 'System.IO.Streams.Combinators.atEndOfOutput' to close the handle+-- if you would like this behaviour.+--+-- /Note/: to force the 'Handle' to be flushed, you can write a null string to+-- the returned 'OutputStream':+--+-- > Streams.write (Just "") os+--+-- /Since: 1.3.4.0./+handleToStreams :: Handle+ -> IO (InputStream ByteString, OutputStream ByteString)+handleToStreams h = do+ is <- handleToInputStream h+ os <- handleToOutputStream h+ return $! (is, os) ------------------------------------------------------------------------------