@@ -132,14 +132,14 @@ evalWithD modifier m = D.Stream step Nothing
132132-- appending two streams
133133-------------------------------------------------------------------------------
134134
135−{-# INLINE appendGeneric #-}
136−appendGeneric :: MonadAsync m =>
135+{-# INLINE _appendGeneric #-}
136+_appendGeneric :: MonadAsync m =>
137137 ((Config -> Config) -> m (Channel m a))
138138 -> (Config -> Config)
139139 -> K.Stream m a
140140 -> K.Stream m a
141141 -> K.Stream m a
142−appendGeneric newChan modifier stream1 stream2 = K.concatEffect action
142+_appendGeneric newChan modifier stream1 stream2 = K.concatEffect action
143143
144144 where
145145
@@ -164,14 +164,22 @@ appendGeneric newChan modifier stream1 stream2 = K.concatEffect action
164164{-# INLINE appendWithK #-}
165165appendWithK :: MonadAsync m =>
166166 (Config -> Config) -> K.Stream m a -> K.Stream m a -> K.Stream m a
167−appendWithK = appendGeneric Append.newChannel
167+appendWithK modifier stream1 stream2 =
168+{-
169+ if getOrdered (modifier defaultConfig)
170+ then concatMapWithK modifier id (stream1 `K.cons` K.fromPure stream2)
171+ else _appendGeneric Append.newChannel modifier stream1 stream2
172+-}
173+ concatMapWithK modifier id (stream1 `K.cons` K.fromPure stream2)
168174
169175-- | Create a new channel and add both the streams to it for async evaluation.
170176-- The output stream is the result of the evaluation.
171177{-# INLINE interleaveWithK #-}
172178interleaveWithK :: MonadAsync m =>
173179 (Config -> Config) -> K.Stream m a -> K.Stream m a -> K.Stream m a
174−interleaveWithK = appendGeneric Interleave.newChannel
180+-- interleaveWithK = _appendGeneric Interleave.newChannel
181+interleaveWithK modifier stream1 stream2 =
182+ concatMapInterleaveWithK modifier id (stream1 `K.cons` K.fromPure stream2)
175183
176184-- | Evaluate the first stream in the current thread and add the second stream
177185-- to the supplied channel. This is to be used by a worker thread.