network-conduit 0.3.0 → 0.4.0
raw patch · 2 files changed
+12/−10 lines, 2 filesdep ~conduitdep ~transformersPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: conduit, transformers
API changes (from Hackage documentation)
Files
- Data/Conduit/Network.hs +9/−7
- network-conduit.cabal +3/−3
Data/Conduit/Network.hs view
@@ -31,6 +31,7 @@ import Control.Monad.Trans.Control (MonadBaseControl, control) import Control.Concurrent (forkIO) import Data.String (IsString (fromString))+import qualified Control.Exception as E -- | Stream data from the socket. --@@ -41,11 +42,11 @@ sourceSocket socket = src where- src = SourceM pull close+ src = PipeM pull close pull = do bs <- liftIO (recv socket 4096)- return $ if S.null bs then Closed else Open src close bs+ return $ if S.null bs then Done Nothing () else HaveOutput src close bs close = return () -- | Stream data to the socket.@@ -55,12 +56,13 @@ -- Since 0.0.0 sinkSocket :: MonadIO m => Socket -> Sink ByteString m () sinkSocket socket =- Processing push close+ sink where- push bs = SinkM $ do+ sink = NeedInput push (Done Nothing ())++ push bs = PipeM (do liftIO (sendAll socket bs)- return (Processing push close)- close = return ()+ return sink) (return ()) -- | A simple TCP application. It takes two arguments: the @Source@ to read -- input data from, and the @Sink@ to send output data to.@@ -197,7 +199,7 @@ _ -> addrs tryAddrs (addr1:rest@(_:_)) =- catch+ E.catch (theBody addr1) (\(_ :: IOException) -> tryAddrs rest) tryAddrs (addr1:[]) = theBody addr1
network-conduit.cabal view
@@ -1,5 +1,5 @@ Name: network-conduit-Version: 0.3.0+Version: 0.4.0 Synopsis: Stream socket data using conduits. Description: Stream socket data using conduits. License: BSD3@@ -18,9 +18,9 @@ Library Exposed-modules: Data.Conduit.Network Build-depends: base >= 4 && < 5- , transformers >= 0.2.2 && < 0.3+ , transformers >= 0.2.2 && < 0.4 , bytestring >= 0.9- , conduit >= 0.3 && < 0.4+ , conduit >= 0.4 && < 0.5 , lifted-base >= 0.1 && < 0.2 , monad-control >= 0.3 && < 0.4 if flag(network-bytestring)