on master help sign in
Make formattting changes in network modules (#1851)
commit05ff41e9469d80399a0cd497904d350eac48cecb authorRanjeet Ranjan <ranjeetr@composewell.com> dateThu 29 Sep 2022, 02:15 (4 years ago) parent70e4a57
2 files changed+9−6
src/Streamly/Internal/Network/Inet/TCP.hs+5−2 src/Streamly/Internal/Network/Socket.hs+4−4
src/Streamly/Internal/Network/Inet/TCP.hs+5−2
@@ -107,7 +107,7 @@ import Streamly.Internal.Control.Concurrent (MonadAsync)
107107import Streamly.Internal.Control.ForkLifted (fork)
108108import Streamly.Internal.Data.Array.Unboxed.Type (Array(..), writeNUnsafe)
109109import Streamly.Internal.Data.Fold.Type (Fold(..))
110−import Streamly.Internal.Data.Stream (Stream)
110+import Streamly.Data.Stream (Stream)
111111import Streamly.Internal.Data.Tuple.Strict (Tuple'(..))
112112import Streamly.Internal.Data.Unfold.Type (Unfold(..))
113113import Streamly.Internal.Network.Socket (SockSpec(..), accept, connections)
@@ -302,7 +302,10 @@ usingConnection =
302302-- /Pre-release/
303303{-# INLINE withConnection #-}
304304withConnection :: (MonadCatch m, MonadAsync m)
305− => (Word8, Word8, Word8, Word8) -> PortNumber -> (Socket -> Stream m a) -> Stream m a
305+ => (Word8, Word8, Word8, Word8)
306+ -> PortNumber
307+ -> (Socket -> Stream m a)
308+ -> Stream m a
306309withConnection addr port =
307310 S.bracket (liftIO $ connect addr port) (liftIO . Net.close)
308311
src/Streamly/Internal/Network/Socket.hs+4−4
@@ -434,7 +434,7 @@ readWith chunkSize h = A.flattenArrays $ readChunksUpto chunkSize h
434434--
435435-- @since 0.7.0
436436{-# INLINE toBytes #-}
437−toBytes :: (MonadIO m) => Socket -> Stream m Word8
437+toBytes :: MonadIO m => Socket -> Stream m Word8
438438toBytes = AS.concat . toChunks
439439
440440-- | Unfolds the tuple @(bufsize, socket)@ into a byte stream, read requests
@@ -590,7 +590,7 @@ write = toHandleWith defaultChunkSize
590590--
591591-- @since 0.7.0
592592{-# INLINE readUtf8 #-}
593−readUtf8 :: (MonadIO m) => Handle -> Stream m Char
593+readUtf8 :: MonadIO m => Handle -> Stream m Char
594594readUtf8 = decodeUtf8 . read
595595
596596-- |
@@ -612,7 +612,7 @@ writeUtf8 h s = write h $ encodeUtf8 s
612612--
613613-- @since 0.7.0
614614{-# INLINE writeUtf8ByLines #-}
615−writeUtf8ByLines :: (MonadIO m) => Handle -> Stream m Char -> m ()
615+writeUtf8ByLines :: MonadIO m => Handle -> Stream m Char -> m ()
616616writeUtf8ByLines = undefined
617617
618618-- | Read UTF-8 lines from a file handle and apply the specified fold to each
@@ -620,7 +620,7 @@ writeUtf8ByLines = undefined
620620--
621621-- @since 0.7.0
622622{-# INLINE readLines #-}
623−readLines :: (MonadIO m) => Handle -> Fold m Char b -> Stream m b
623+readLines :: MonadIO m => Handle -> Fold m Char b -> Stream m b
624624readLines h f = foldLines (readUtf8 h) f
625625
626626-------------------------------------------------------------------------------