@@ -252,7 +252,7 @@ joinLeft eq s1 s2 = Stream.evalStateT (return False) $ getCrossStream $ do
252 -- XXX Is there a better way to perform some action at the end of a loop
252 -- XXX Is there a better way to perform some action at the end of a loop
253 -- iteration?
253 -- iteration?
254 CrossStream (Stream.fromEffect $ put False)
254 CrossStream (Stream.fromEffect $ put False)
255− let final = Stream.concatM $ do
255+ let final = Stream.concatEffect $ do
258 then pure Stream.nil
258 then pure Stream.nil
@@ -300,7 +300,7 @@ joinOuter :: MonadIO m =>
300 -> Stream m b
300 -> Stream m b
301 -> Stream m (Maybe a, Maybe b)
301 -> Stream m (Maybe a, Maybe b)
302joinOuter eq s1 s =
302joinOuter eq s1 s =
303− Stream.concatM $ do
303+ Stream.concatEffect $ do
304 inputArr <- Array.fromStream s
304 inputArr <- Array.fromStream s
305 let len = Array.length inputArr
305 let len = Array.length inputArr
306 foundArr <-
306 foundArr <-
@@ -331,7 +331,7 @@ joinOuter eq s1 s =
331 -- XXX Is there a better way to perform some action at the end of a loop
331 -- XXX Is there a better way to perform some action at the end of a loop
332 -- iteration?
332 -- iteration?
333 CrossStream (Stream.fromEffect $ put False)
333 CrossStream (Stream.fromEffect $ put False)
334− let final = Stream.concatM $ do
334+ let final = Stream.concatEffect $ do
337 then pure Stream.nil
337 then pure Stream.nil
@@ -398,7 +398,7 @@ mergeOuterJoin _eq _s1 _s2 = undefined
398intersectBy :: Monad m =>
398intersectBy :: Monad m =>
399 (a -> a -> Bool) -> Stream m a -> Stream m a -> Stream m a
399 (a -> a -> Bool) -> Stream m a -> Stream m a -> Stream m a
400intersectBy eq s1 s2 =
400intersectBy eq s1 s2 =
401− Stream.concatM
401+ Stream.concatEffect
403 -- This may work well when s2 is small
403 -- This may work well when s2 is small
404 xs <- Stream.fold Fold.toListRev $ Stream.uniqBy eq s2
404 xs <- Stream.fold Fold.toListRev $ Stream.uniqBy eq s2
@@ -447,7 +447,7 @@ intersectBySorted eq s1 =
447differenceBy :: (Monad m) =>
447differenceBy :: (Monad m) =>
448 (a -> a -> Bool) -> Stream m a -> Stream m a -> Stream m a
448 (a -> a -> Bool) -> Stream m a -> Stream m a -> Stream m a
449differenceBy eq s1 s2 =
449differenceBy eq s1 s2 =
450− Stream.concatM
450+ Stream.concatEffect
452 -- This may work well if s1 is small
452 -- This may work well if s1 is small
453 -- If s1 is big we can go through s1, deleting elements from s2 and
453 -- If s1 is big we can go through s1, deleting elements from s2 and
@@ -492,7 +492,7 @@ mergeDifferenceBy _eq _s1 _s2 = undefined
492unionBy :: MonadIO m =>
492unionBy :: MonadIO m =>
493 (a -> a -> Bool) -> Stream m a -> Stream m a -> Stream m a
493 (a -> a -> Bool) -> Stream m a -> Stream m a -> Stream m a
494unionBy eq s1 s2 =
494unionBy eq s1 s2 =
495− Stream.concatM
495+ Stream.concatEffect
497 xs <- Stream.fold Fold.toList s2
497 xs <- Stream.fold Fold.toList s2
498 -- XXX we can use postscanlMAfter' instead of IORef
498 -- XXX we can use postscanlMAfter' instead of IORef
@@ -500,7 +500,7 @@ unionBy eq s1 s2 =
500 let f x = do
500 let f x = do
501 liftIO $ modifyIORef' ref (List.deleteBy eq x)
501 liftIO $ modifyIORef' ref (List.deleteBy eq x)
503− s3 = Stream.concatM
503+ s3 = Stream.concatEffect
505 xs1 <- liftIO $ readIORef ref
505 xs1 <- liftIO $ readIORef ref
506 return $ Stream.fromList xs1
506 return $ Stream.fromList xs1