mirror of
https://github.com/composewell/streamly.git
synced 2024-09-11 19:47:10 +03:00
Rename conflicting newChannel in Append/Interleave modules
This commit is contained in:
parent
931eafb88a
commit
3ea7bf24f4
@ -54,11 +54,11 @@ import Streamly.Internal.Control.Concurrent (MonadAsync)
|
||||
import Streamly.Internal.Data.Stream (Stream)
|
||||
import Streamly.Internal.Data.Stream.Concurrent.Channel.Operations
|
||||
(fromChannel, fromChannelK, toChannel, toChannelK)
|
||||
import Streamly.Internal.Data.Stream.Concurrent.Channel.Append
|
||||
(newAppendChannel)
|
||||
import Streamly.Internal.Data.Stream.Concurrent.Channel.Interleave
|
||||
(newInterleaveChannel)
|
||||
|
||||
import qualified Streamly.Internal.Data.Stream.Concurrent.Channel.Append
|
||||
as Append
|
||||
import qualified Streamly.Internal.Data.Stream.Concurrent.Channel.Interleave
|
||||
as Interleave
|
||||
import qualified Streamly.Internal.Data.StreamK as K
|
||||
|
||||
import Streamly.Internal.Data.Stream.Concurrent.Channel.Type
|
||||
@ -73,8 +73,8 @@ newChannel :: MonadAsync m =>
|
||||
newChannel modifier =
|
||||
let cfg = modifier defaultConfig
|
||||
in if getInterleaved cfg
|
||||
then Interleave.newChannel modifier
|
||||
else Append.newChannel modifier
|
||||
then newInterleaveChannel modifier
|
||||
else newAppendChannel modifier
|
||||
|
||||
-- | Allocate a channel and evaluate the stream using the channel and the
|
||||
-- supplied evaluator function. The evaluator is run in a worker thread.
|
||||
|
@ -7,7 +7,7 @@
|
||||
-- Portability : GHC
|
||||
--
|
||||
-- The functions in this module are separated from the combinators using
|
||||
-- these because of a GHC issue. We need to have newChannel specialized but
|
||||
-- these because of a GHC issue. We need to have newAppendChannel specialized but
|
||||
-- not inlined. If we keep it in the same module as its users we cannot achieve
|
||||
-- that and the code becomes bloated. But if it is in a separate module we can
|
||||
-- use INLINABLE and SPECIALIZE on it which makes it specialized but it is not
|
||||
@ -15,7 +15,7 @@
|
||||
|
||||
module Streamly.Internal.Data.Stream.Concurrent.Channel.Append
|
||||
(
|
||||
newChannel
|
||||
newAppendChannel
|
||||
)
|
||||
where
|
||||
|
||||
@ -1037,10 +1037,10 @@ getLifoSVar mrun cfg = do
|
||||
|
||||
-- | Create a new async style concurrent stream evaluation channel. The monad
|
||||
-- state used to run the stream actions is taken from the call site of
|
||||
-- newChannel.
|
||||
{-# INLINABLE newChannel #-}
|
||||
{-# SPECIALIZE newChannel :: (Config -> Config) -> IO (Channel IO a) #-}
|
||||
newChannel :: MonadRunInIO m => (Config -> Config) -> m (Channel m a)
|
||||
newChannel modifier = do
|
||||
-- newAppendChannel.
|
||||
{-# INLINABLE newAppendChannel #-}
|
||||
{-# SPECIALIZE newAppendChannel :: (Config -> Config) -> IO (Channel IO a) #-}
|
||||
newAppendChannel :: MonadRunInIO m => (Config -> Config) -> m (Channel m a)
|
||||
newAppendChannel modifier = do
|
||||
mrun <- askRunInIO
|
||||
liftIO $ getLifoSVar mrun (modifier defaultConfig)
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
module Streamly.Internal.Data.Stream.Concurrent.Channel.Interleave
|
||||
(
|
||||
newChannel
|
||||
newInterleaveChannel
|
||||
)
|
||||
where
|
||||
|
||||
@ -242,11 +242,11 @@ getFifoSVar mrun cfg = do
|
||||
--
|
||||
-- | Create a new async style concurrent stream evaluation channel. The monad
|
||||
-- state used to run the stream actions is taken from the call site of
|
||||
-- newChannel.
|
||||
{-# INLINABLE newChannel #-}
|
||||
{-# SPECIALIZE newChannel :: (Config -> Config) -> IO (Channel IO a) #-}
|
||||
newChannel :: MonadAsync m =>
|
||||
-- newInterleaveChannel.
|
||||
{-# INLINABLE newInterleaveChannel #-}
|
||||
{-# SPECIALIZE newInterleaveChannel :: (Config -> Config) -> IO (Channel IO a) #-}
|
||||
newInterleaveChannel :: MonadAsync m =>
|
||||
(Config -> Config) -> m (Channel m a)
|
||||
newChannel modifier = do
|
||||
newInterleaveChannel modifier = do
|
||||
mrun <- askRunInIO
|
||||
liftIO $ getFifoSVar mrun (modifier defaultConfig)
|
||||
|
Loading…
Reference in New Issue
Block a user