on master help sign in
Rename conflicting newChannel in Append/Interleave modules
3ea7bf2Harendra Kumar
src/Streamly/Internal/Data/Stream/Concurrent/Channel.hs+6−6
@@ -54,11 +54,11 @@ import Streamly.Internal.Control.Concurrent (MonadAsync)
54import Streamly.Internal.Data.Stream (Stream)
54import Streamly.Internal.Data.Stream (Stream)
55import Streamly.Internal.Data.Stream.Concurrent.Channel.Operations
55import Streamly.Internal.Data.Stream.Concurrent.Channel.Operations
56 (fromChannel, fromChannelK, toChannel, toChannelK)
56 (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)
57
61
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
62import qualified Streamly.Internal.Data.StreamK as K
62import qualified Streamly.Internal.Data.StreamK as K
63
63
64import Streamly.Internal.Data.Stream.Concurrent.Channel.Type
64import Streamly.Internal.Data.Stream.Concurrent.Channel.Type
@@ -73,8 +73,8 @@ newChannel :: MonadAsync m =>
73newChannel modifier =
73newChannel modifier =
74 let cfg = modifier defaultConfig
74 let cfg = modifier defaultConfig
75 in if getInterleaved cfg
75 in if getInterleaved cfg
76− then Interleave.newChannel modifier
76+ then newInterleaveChannel modifier
77− else Append.newChannel modifier
77+ else newAppendChannel modifier
78
78
79-- | Allocate a channel and evaluate the stream using the channel and the
79-- | Allocate a channel and evaluate the stream using the channel and the
80-- supplied evaluator function. The evaluator is run in a worker thread.
80-- 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 @@
7-- Portability : GHC
7-- Portability : GHC
8--
8--
9-- The functions in this module are separated from the combinators using
9-- 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
11-- not inlined. If we keep it in the same module as its users we cannot achieve
11-- not inlined. If we keep it in the same module as its users we cannot achieve
12-- that and the code becomes bloated. But if it is in a separate module we can
12-- that and the code becomes bloated. But if it is in a separate module we can
13-- use INLINABLE and SPECIALIZE on it which makes it specialized but it is not
13-- use INLINABLE and SPECIALIZE on it which makes it specialized but it is not
@@ -15,7 +15,7 @@
15
15
16module Streamly.Internal.Data.Stream.Concurrent.Channel.Append
16module Streamly.Internal.Data.Stream.Concurrent.Channel.Append
17 (
17 (
18− newChannel
18+ newAppendChannel
19 )
19 )
20where
20where
21
21
@@ -1037,10 +1037,10 @@ getLifoSVar mrun cfg = do
1037
1037
1038-- | Create a new async style concurrent stream evaluation channel. The monad
1038-- | Create a new async style concurrent stream evaluation channel. The monad
1039-- state used to run the stream actions is taken from the call site of
1039-- state used to run the stream actions is taken from the call site of
1040−-- newChannel.
1040+-- newAppendChannel.
1041−{-# INLINABLE newChannel #-}
1041+{-# INLINABLE newAppendChannel #-}
1042−{-# SPECIALIZE newChannel :: (Config -> Config) -> IO (Channel IO a) #-}
1042+{-# SPECIALIZE newAppendChannel :: (Config -> Config) -> IO (Channel IO a) #-}
1043−newChannel :: MonadRunInIO m => (Config -> Config) -> m (Channel m a)
1043+newAppendChannel :: MonadRunInIO m => (Config -> Config) -> m (Channel m a)
1044−newChannel modifier = do
1044+newAppendChannel modifier = do
1045 mrun <- askRunInIO
1045 mrun <- askRunInIO
1046 liftIO $ getLifoSVar mrun (modifier defaultConfig)
1046 liftIO $ getLifoSVar mrun (modifier defaultConfig)
src/Streamly/Internal/Data/Stream/Concurrent/Channel/Interleave.hs+6−6
@@ -8,7 +8,7 @@
8
8
9module Streamly.Internal.Data.Stream.Concurrent.Channel.Interleave
9module Streamly.Internal.Data.Stream.Concurrent.Channel.Interleave
10 (
10 (
11− newChannel
11+ newInterleaveChannel
12 )
12 )
13where
13where
14
14
@@ -242,11 +242,11 @@ getFifoSVar mrun cfg = do
242--
242--
243-- | Create a new async style concurrent stream evaluation channel. The monad
243-- | Create a new async style concurrent stream evaluation channel. The monad
244-- state used to run the stream actions is taken from the call site of
244-- state used to run the stream actions is taken from the call site of
245−-- newChannel.
245+-- newInterleaveChannel.
246−{-# INLINABLE newChannel #-}
246+{-# INLINABLE newInterleaveChannel #-}
247−{-# SPECIALIZE newChannel :: (Config -> Config) -> IO (Channel IO a) #-}
247+{-# SPECIALIZE newInterleaveChannel :: (Config -> Config) -> IO (Channel IO a) #-}
248−newChannel :: MonadAsync m =>
248+newInterleaveChannel :: MonadAsync m =>
249 (Config -> Config) -> m (Channel m a)
249 (Config -> Config) -> m (Channel m a)
250−newChannel modifier = do
250+newInterleaveChannel modifier = do
251 mrun <- askRunInIO
251 mrun <- askRunInIO
252 liftIO $ getFifoSVar mrun (modifier defaultConfig)
252 liftIO $ getFifoSVar mrun (modifier defaultConfig)