packages feed

pipes-network 0.6.0 → 0.6.1

raw patch · 4 files changed

+19/−13 lines, 4 filesdep ~pipes-safe

Dependency ranges changed: pipes-safe

Files

NEWS view
@@ -1,5 +1,10 @@ # Version HEAD +* Remove the `Base m ~ IO` constraint from `Pipes.Network.TCP.Safe`+++# Version 0.6.0+ * Significantly upgraded the API and renamed functions to play well with   pipes-4.0.0, pipes-safe-2.0.0 and network-simple-0.3.0. 
pipes-network.cabal view
@@ -1,5 +1,5 @@ name:               pipes-network-version:            0.6.0+version:            0.6.1 license:            BSD3 license-file:       LICENSE copyright:          Copyright (c) Renzo Carbonara 2012-2013, Paolo Capriotti 2012-2012.@@ -43,7 +43,7 @@         network,         network-simple (>=0.3 && <0.4),         pipes          (>=4.0 && <4.1),-        pipes-safe     (>=2.0 && <2.1),+        pipes-safe     (>=2.0.1 && <2.1),         transformers   (>=0.2 && <0.4)     exposed-modules:         Pipes.Network.TCP
src/Pipes/Network/TCP.hs view
@@ -57,7 +57,7 @@  -------------------------------------------------------------------------------- --- | Receives bytes from the remote end sends them downstream.+-- | Receives bytes from the remote end and sends them downstream. -- -- The number of bytes received at once is always in the interval -- /[1 .. specified maximum]/.
src/Pipes/Network/TCP/Safe.hs view
@@ -61,15 +61,15 @@ -- | Like 'Network.Simple.TCP.connect' from "Network.Simple.TCP", but compatible -- with 'Ps.MonadSafe'. connect-  :: (Ps.MonadSafe m, Ps.Base m ~ IO)+  :: (Ps.MonadSafe m)   => HostName -> ServiceName -> ((Socket, SockAddr) -> m r) -> m r connect host port = Ps.bracket (connectSock host port)-                               (NS.sClose . fst)+                               (liftIO . NS.sClose . fst)  -- | Like 'Network.Simple.TCP.serve' from "Network.Simple.TCP", but compatible -- with 'Ps.MonadSafe'. serve-  :: (Ps.MonadSafe m, Ps.Base m ~ IO)+  :: (Ps.MonadSafe m)   => HostPreference -> ServiceName -> ((Socket, SockAddr) -> IO ()) -> m r serve hp port k = do    listen hp port $ \(lsock,_) -> do@@ -78,22 +78,23 @@ -- | Like 'Network.Simple.TCP.listen' from "Network.Simple.TCP", but compatible -- with 'Ps.MonadSafe'. listen-  :: (Ps.MonadSafe m, Ps.Base m ~ IO)+  :: (Ps.MonadSafe m)   => HostPreference -> ServiceName -> ((Socket, SockAddr) -> m r) -> m r-listen hp port = Ps.bracket listen' (NS.sClose . fst)+listen hp port = Ps.bracket listen' (liftIO . NS.sClose . fst)   where-    listen' = do x@(bsock,_) <- bindSock hp port-                 NS.listen bsock (max 2048 NS.maxListenQueue)-                 return x+    listen' = liftIO $ do+        x@(bsock,_) <- bindSock hp port+        NS.listen bsock (max 2048 NS.maxListenQueue)+        return x  -- | Like 'Network.Simple.TCP.accept' from "Network.Simple.TCP", but compatible -- with 'Ps.MonadSafe'. accept-  :: (Ps.MonadSafe m, Ps.Base m ~ IO)+  :: (Ps.MonadSafe m)   => Socket -> ((Socket, SockAddr) -> m r) -> m r accept lsock k = do     conn@(csock,_) <- liftIO (NS.accept lsock)-    Ps.finally (k conn) (NS.sClose csock)+    Ps.finally (k conn) (liftIO $ NS.sClose csock) {-# INLINABLE accept #-}  --------------------------------------------------------------------------------