on master help sign in
Rename conflicting newChannel in Append/Interleave modules
commit3ea7bf24f4a05d4310731c2057de0e0cd66fe4c4 authorHarendra Kumar <harendra@composewell.com> dateMon 27 Nov 2023, 02:38 (3 years ago) parent931eafb
3 files changed+19−19
src/Streamly/Internal/Data/Stream/Concurrent/Channel.hs+6−6 src/Streamly/Internal/Data/Stream/Concurrent/Channel/Append.hs+7−7 src/Streamly/Internal/Data/Stream/Concurrent/Channel/Interleave.hs+6−6
src/Streamly/Internal/Data/Stream/Concurrent/Channel.hs+6−6
@@ -54,11 +54,11 @@ import Streamly.Internal.Control.Concurrent (MonadAsync)
5454import Streamly.Internal.Data.Stream (Stream)
5555import Streamly.Internal.Data.Stream.Concurrent.Channel.Operations
5656 (fromChannel, fromChannelK, toChannel, toChannelK)
57+import Streamly.Internal.Data.Stream.Concurrent.Channel.Append
58+ (newAppendChannel)
59+import Streamly.Internal.Data.Stream.Concurrent.Channel.Interleave
60+ (newInterleaveChannel)
5761
58−import qualified Streamly.Internal.Data.Stream.Concurrent.Channel.Append
59− as Append
60−import qualified Streamly.Internal.Data.Stream.Concurrent.Channel.Interleave
61− as Interleave
6262import qualified Streamly.Internal.Data.StreamK as K
6363
6464import Streamly.Internal.Data.Stream.Concurrent.Channel.Type
@@ -73,8 +73,8 @@ newChannel :: MonadAsync m =>
7373newChannel modifier =
7474 let cfg = modifier defaultConfig
7575 in if getInterleaved cfg
76− then Interleave.newChannel modifier
77− else Append.newChannel modifier
76+ then newInterleaveChannel modifier
77+ else newAppendChannel modifier
7878
7979-- | Allocate a channel and evaluate the stream using the channel and the
8080-- supplied evaluator function. The evaluator is run in a worker thread.
src/Streamly/Internal/Data/Stream/Concurrent/Channel/Append.hs+7−7
@@ -7,7 +7,7 @@
77-- Portability : GHC
88--
99-- The functions in this module are separated from the combinators using
10−-- these because of a GHC issue. We need to have newChannel specialized but
10+-- these because of a GHC issue. We need to have newAppendChannel specialized but
1111-- not inlined. If we keep it in the same module as its users we cannot achieve
1212-- that and the code becomes bloated. But if it is in a separate module we can
1313-- use INLINABLE and SPECIALIZE on it which makes it specialized but it is not
@@ -15,7 +15,7 @@
1515
1616module Streamly.Internal.Data.Stream.Concurrent.Channel.Append
1717 (
18− newChannel
18+ newAppendChannel
1919 )
2020where
2121
@@ -1037,10 +1037,10 @@ getLifoSVar mrun cfg = do
10371037
10381038-- | Create a new async style concurrent stream evaluation channel. The monad
10391039-- state used to run the stream actions is taken from the call site of
1040−-- newChannel.
1041−{-# INLINABLE newChannel #-}
1042−{-# SPECIALIZE newChannel :: (Config -> Config) -> IO (Channel IO a) #-}
1043−newChannel :: MonadRunInIO m => (Config -> Config) -> m (Channel m a)
1044−newChannel modifier = do
1040+-- newAppendChannel.
1041+{-# INLINABLE newAppendChannel #-}
1042+{-# SPECIALIZE newAppendChannel :: (Config -> Config) -> IO (Channel IO a) #-}
1043+newAppendChannel :: MonadRunInIO m => (Config -> Config) -> m (Channel m a)
1044+newAppendChannel modifier = do
10451045 mrun <- askRunInIO
10461046 liftIO $ getLifoSVar mrun (modifier defaultConfig)
src/Streamly/Internal/Data/Stream/Concurrent/Channel/Interleave.hs+6−6
@@ -8,7 +8,7 @@
88
99module Streamly.Internal.Data.Stream.Concurrent.Channel.Interleave
1010 (
11− newChannel
11+ newInterleaveChannel
1212 )
1313where
1414
@@ -242,11 +242,11 @@ getFifoSVar mrun cfg = do
242242--
243243-- | Create a new async style concurrent stream evaluation channel. The monad
244244-- state used to run the stream actions is taken from the call site of
245−-- newChannel.
246−{-# INLINABLE newChannel #-}
247−{-# SPECIALIZE newChannel :: (Config -> Config) -> IO (Channel IO a) #-}
248−newChannel :: MonadAsync m =>
245+-- newInterleaveChannel.
246+{-# INLINABLE newInterleaveChannel #-}
247+{-# SPECIALIZE newInterleaveChannel :: (Config -> Config) -> IO (Channel IO a) #-}
248+newInterleaveChannel :: MonadAsync m =>
249249 (Config -> Config) -> m (Channel m a)
250−newChannel modifier = do
250+newInterleaveChannel modifier = do
251251 mrun <- askRunInIO
252252 liftIO $ getFifoSVar mrun (modifier defaultConfig)