on master help sign in
Rename getCrossStream to unCrossStream (#2140)
add9565Ranjeet Ranjan
benchmark/Streamly/Benchmark/Data/Stream/Common.hs+13−13
@@ -228,7 +228,7 @@ sourceConcatMapId value n =
228{-# INLINE apDiscardFst #-}
228{-# INLINE apDiscardFst #-}
229apDiscardFst :: MonadAsync m =>
229apDiscardFst :: MonadAsync m =>
230 Int -> Int -> m ()
230 Int -> Int -> m ()
231−apDiscardFst linearCount start = drain $ getCrossStream $
231+apDiscardFst linearCount start = drain $ unCrossStream $
232 CrossStream (sourceUnfoldrM nestedCount2 start)
232 CrossStream (sourceUnfoldrM nestedCount2 start)
233 *> CrossStream (sourceUnfoldrM nestedCount2 start)
233 *> CrossStream (sourceUnfoldrM nestedCount2 start)
234
234
@@ -238,7 +238,7 @@ apDiscardFst linearCount start = drain $ getCrossStream $
238
238
239{-# INLINE apDiscardSnd #-}
239{-# INLINE apDiscardSnd #-}
240apDiscardSnd :: MonadAsync m => Int -> Int -> m ()
240apDiscardSnd :: MonadAsync m => Int -> Int -> m ()
241−apDiscardSnd linearCount start = drain $ getCrossStream $
241+apDiscardSnd linearCount start = drain $ unCrossStream $
242 CrossStream (sourceUnfoldrM nestedCount2 start)
242 CrossStream (sourceUnfoldrM nestedCount2 start)
243 <* CrossStream (sourceUnfoldrM nestedCount2 start)
243 <* CrossStream (sourceUnfoldrM nestedCount2 start)
244
244
@@ -248,7 +248,7 @@ apDiscardSnd linearCount start = drain $ getCrossStream $
248
248
249{-# INLINE apLiftA2 #-}
249{-# INLINE apLiftA2 #-}
250apLiftA2 :: MonadAsync m => Int -> Int -> m ()
250apLiftA2 :: MonadAsync m => Int -> Int -> m ()
251−apLiftA2 linearCount start = drain $ getCrossStream $
251+apLiftA2 linearCount start = drain $ unCrossStream $
252 liftA2 (+) (CrossStream (sourceUnfoldrM nestedCount2 start))
252 liftA2 (+) (CrossStream (sourceUnfoldrM nestedCount2 start))
253 (CrossStream (sourceUnfoldrM nestedCount2 start))
253 (CrossStream (sourceUnfoldrM nestedCount2 start))
254
254
@@ -258,7 +258,7 @@ apLiftA2 linearCount start = drain $ getCrossStream $
258
258
259{-# INLINE toNullAp #-}
259{-# INLINE toNullAp #-}
260toNullAp :: MonadAsync m => Int -> Int -> m ()
260toNullAp :: MonadAsync m => Int -> Int -> m ()
261−toNullAp linearCount start = drain $ getCrossStream $
261+toNullAp linearCount start = drain $ unCrossStream $
262 (+) <$> CrossStream (sourceUnfoldrM nestedCount2 start)
262 (+) <$> CrossStream (sourceUnfoldrM nestedCount2 start)
263 <*> CrossStream (sourceUnfoldrM nestedCount2 start)
263 <*> CrossStream (sourceUnfoldrM nestedCount2 start)
264
264
@@ -268,7 +268,7 @@ toNullAp linearCount start = drain $ getCrossStream $
268
268
269{-# INLINE monadThen #-}
269{-# INLINE monadThen #-}
270monadThen :: MonadAsync m => Int -> Int -> m ()
270monadThen :: MonadAsync m => Int -> Int -> m ()
271−monadThen linearCount start = drain $ getCrossStream $ do
271+monadThen linearCount start = drain $ unCrossStream $ do
272 CrossStream (sourceUnfoldrM nestedCount2 start) >>
272 CrossStream (sourceUnfoldrM nestedCount2 start) >>
273 CrossStream (sourceUnfoldrM nestedCount2 start)
273 CrossStream (sourceUnfoldrM nestedCount2 start)
274
274
@@ -278,7 +278,7 @@ monadThen linearCount start = drain $ getCrossStream $ do
278
278
279{-# INLINE toNullM #-}
279{-# INLINE toNullM #-}
280toNullM :: MonadAsync m => Int -> Int -> m ()
280toNullM :: MonadAsync m => Int -> Int -> m ()
281−toNullM linearCount start = drain $ getCrossStream $ do
281+toNullM linearCount start = drain $ unCrossStream $ do
282 x <- CrossStream (sourceUnfoldrM nestedCount2 start)
282 x <- CrossStream (sourceUnfoldrM nestedCount2 start)
283 y <- CrossStream (sourceUnfoldrM nestedCount2 start)
283 y <- CrossStream (sourceUnfoldrM nestedCount2 start)
284 return $ x + y
284 return $ x + y
@@ -289,7 +289,7 @@ toNullM linearCount start = drain $ getCrossStream $ do
289
289
290{-# INLINE toNullM3 #-}
290{-# INLINE toNullM3 #-}
291toNullM3 :: MonadAsync m => Int -> Int -> m ()
291toNullM3 :: MonadAsync m => Int -> Int -> m ()
292−toNullM3 linearCount start = drain $ getCrossStream $ do
292+toNullM3 linearCount start = drain $ unCrossStream $ do
293 x <- CrossStream (sourceUnfoldrM nestedCount3 start)
293 x <- CrossStream (sourceUnfoldrM nestedCount3 start)
294 y <- CrossStream (sourceUnfoldrM nestedCount3 start)
294 y <- CrossStream (sourceUnfoldrM nestedCount3 start)
295 z <- CrossStream (sourceUnfoldrM nestedCount3 start)
295 z <- CrossStream (sourceUnfoldrM nestedCount3 start)
@@ -299,7 +299,7 @@ toNullM3 linearCount start = drain $ getCrossStream $ do
299
299
300{-# INLINE filterAllOutM #-}
300{-# INLINE filterAllOutM #-}
301filterAllOutM :: MonadAsync m => Int -> Int -> m ()
301filterAllOutM :: MonadAsync m => Int -> Int -> m ()
302−filterAllOutM linearCount start = drain $ getCrossStream $ do
302+filterAllOutM linearCount start = drain $ unCrossStream $ do
303 x <- CrossStream (sourceUnfoldrM nestedCount2 start)
303 x <- CrossStream (sourceUnfoldrM nestedCount2 start)
304 y <- CrossStream (sourceUnfoldrM nestedCount2 start)
304 y <- CrossStream (sourceUnfoldrM nestedCount2 start)
305 let s = x + y
305 let s = x + y
@@ -311,7 +311,7 @@ filterAllOutM linearCount start = drain $ getCrossStream $ do
311
311
312{-# INLINE filterAllInM #-}
312{-# INLINE filterAllInM #-}
313filterAllInM :: MonadAsync m => Int -> Int -> m ()
313filterAllInM :: MonadAsync m => Int -> Int -> m ()
314−filterAllInM linearCount start = drain $ getCrossStream $ do
314+filterAllInM linearCount start = drain $ unCrossStream $ do
315 x <- CrossStream (sourceUnfoldrM nestedCount2 start)
315 x <- CrossStream (sourceUnfoldrM nestedCount2 start)
316 y <- CrossStream (sourceUnfoldrM nestedCount2 start)
316 y <- CrossStream (sourceUnfoldrM nestedCount2 start)
317 let s = x + y
317 let s = x + y
@@ -323,7 +323,7 @@ filterAllInM linearCount start = drain $ getCrossStream $ do
323
323
324{-# INLINE filterSome #-}
324{-# INLINE filterSome #-}
325filterSome :: MonadAsync m => Int -> Int -> m ()
325filterSome :: MonadAsync m => Int -> Int -> m ()
326−filterSome linearCount start = drain $ getCrossStream $ do
326+filterSome linearCount start = drain $ unCrossStream $ do
327 x <- CrossStream (sourceUnfoldrM nestedCount2 start)
327 x <- CrossStream (sourceUnfoldrM nestedCount2 start)
328 y <- CrossStream (sourceUnfoldrM nestedCount2 start)
328 y <- CrossStream (sourceUnfoldrM nestedCount2 start)
329 let s = x + y
329 let s = x + y
@@ -336,7 +336,7 @@ filterSome linearCount start = drain $ getCrossStream $ do
336{-# INLINE breakAfterSome #-}
336{-# INLINE breakAfterSome #-}
337breakAfterSome :: Int -> Int -> IO ()
337breakAfterSome :: Int -> Int -> IO ()
338breakAfterSome linearCount start = do
338breakAfterSome linearCount start = do
339− (_ :: Either ErrorCall ()) <- try $ drain $ getCrossStream $ do
339+ (_ :: Either ErrorCall ()) <- try $ drain $ unCrossStream $ do
340 x <- CrossStream (sourceUnfoldrM nestedCount2 start)
340 x <- CrossStream (sourceUnfoldrM nestedCount2 start)
341 y <- CrossStream (sourceUnfoldrM nestedCount2 start)
341 y <- CrossStream (sourceUnfoldrM nestedCount2 start)
342 let s = x + y
342 let s = x + y
@@ -349,7 +349,7 @@ breakAfterSome linearCount start = do
349
349
350{-# INLINE toListM #-}
350{-# INLINE toListM #-}
351toListM :: MonadAsync m => Int -> Int -> m [Int]
351toListM :: MonadAsync m => Int -> Int -> m [Int]
352−toListM linearCount start = Stream.fold Fold.toList $ getCrossStream $ do
352+toListM linearCount start = Stream.fold Fold.toList $ unCrossStream $ do
353 x <- CrossStream (sourceUnfoldrM nestedCount2 start)
353 x <- CrossStream (sourceUnfoldrM nestedCount2 start)
354 y <- CrossStream (sourceUnfoldrM nestedCount2 start)
354 y <- CrossStream (sourceUnfoldrM nestedCount2 start)
355 return $ x + y
355 return $ x + y
@@ -361,7 +361,7 @@ toListM linearCount start = Stream.fold Fold.toList $ getCrossStream $ do
361{-# INLINE toListSome #-}
361{-# INLINE toListSome #-}
362toListSome :: MonadAsync m => Int -> Int -> m [Int]
362toListSome :: MonadAsync m => Int -> Int -> m [Int]
363toListSome linearCount start =
363toListSome linearCount start =
364− Stream.fold Fold.toList $ Stream.take 10000 $ getCrossStream $ do
364+ Stream.fold Fold.toList $ Stream.take 10000 $ unCrossStream $ do
365 x <- CrossStream (sourceUnfoldrM nestedCount2 start)
365 x <- CrossStream (sourceUnfoldrM nestedCount2 start)
366 y <- CrossStream (sourceUnfoldrM nestedCount2 start)
366 y <- CrossStream (sourceUnfoldrM nestedCount2 start)
367 return $ x + y
367 return $ x + y
benchmark/Streamly/Benchmark/Data/Stream/Expand.hs+1−1
@@ -76,7 +76,7 @@ iterateSingleton ::
76 -> Int
76 -> Int
77 -> Stream m Int
77 -> Stream m Int
78iterateSingleton g count n =
78iterateSingleton g count n =
79− getCrossStream $ iterateN g (CrossStream (S.fromPure n)) count
79+ unCrossStream $ iterateN g (CrossStream (S.fromPure n)) count
80
80
81{-
81{-
82-- XXX need to check why this is slower than the explicit recursion above, even
82-- XXX need to check why this is slower than the explicit recursion above, even
benchmark/Streamly/Benchmark/Data/Stream/Generate.hs+1−1
@@ -179,7 +179,7 @@ fromIndicesM value n = S.take value $ S.fromIndicesM (return <$> (+ n))
179mfixUnfold :: Int -> Int -> Stream IO (Int, Int)
179mfixUnfold :: Int -> Int -> Stream IO (Int, Int)
180mfixUnfold count start = Stream.mfix f
180mfixUnfold count start = Stream.mfix f
181 where
181 where
182− f action = getCrossStream $ do
182+ f action = unCrossStream $ do
183 let incr n act = fmap ((+n) . snd) $ unsafeInterleaveIO act
183 let incr n act = fmap ((+n) . snd) $ unsafeInterleaveIO act
184 x <- CrossStream (Common.fromListM [incr 1 action, incr 2 action])
184 x <- CrossStream (Common.fromListM [incr 1 action, incr 2 action])
185 y <- CrossStream (Common.sourceUnfoldr count start)
185 y <- CrossStream (Common.sourceUnfoldr count start)
benchmark/Streamly/Benchmark/Data/Stream/Transform.hs+1−1
@@ -177,7 +177,7 @@ foldrSMap n = composeN n $ Stream.foldrS (\x xs -> x + 1 `Stream.cons` xs) Strea
177{-
177{-
178{-# INLINE foldrT #-}
178{-# INLINE foldrT #-}
179foldrT :: MonadIO m => Int -> Stream m Int -> m ()
179foldrT :: MonadIO m => Int -> Stream m Int -> m ()
180−foldrT n = composeN n (getCrossStream . Stream.foldrT cns (CrossStream Stream.nil))
180+foldrT n = composeN n (unCrossStream . Stream.foldrT cns (CrossStream Stream.nil))
181
181
182 where cns x (CrossStream xs) = CrossStream (Stream.cons x xs)
182 where cns x (CrossStream xs) = CrossStream (Stream.cons x xs)
183
183
core/src/Streamly/Internal/Data/List.hs+2−2
@@ -87,7 +87,7 @@ newtype List a = List { toCrossStream :: CrossStream Identity a }
87 , Applicative, Traversable, Monad, IsList)
87 , Applicative, Traversable, Monad, IsList)
88
88
89toStream :: List a -> Stream Identity a
89toStream :: List a -> Stream Identity a
90−toStream = getCrossStream . toCrossStream
90+toStream = unCrossStream . toCrossStream
91
91
92fromStream :: Stream Identity a -> List a
92fromStream :: Stream Identity a -> List a
93fromStream xs = List (CrossStream xs)
93fromStream xs = List (CrossStream xs)
@@ -97,7 +97,7 @@ instance (a ~ Char) => IsString (List a) where
97 fromString = List . fromList
97 fromString = List . fromList
98
98
99instance Show a => Show (List a) where
99instance Show a => Show (List a) where
100− show (List x) = show $ getCrossStream x
100+ show (List x) = show $ unCrossStream x
101
101
102instance Read a => Read (List a) where
102instance Read a => Read (List a) where
103 readPrec = fromStream <$> readPrec
103 readPrec = fromStream <$> readPrec
core/src/Streamly/Internal/Data/Stream/Cross.hs+4−4
@@ -42,7 +42,7 @@ import qualified Streamly.Internal.Data.Stream.StreamK.Type as K
42-- A 'Monad' bind behaves like a @for@ loop:
42-- A 'Monad' bind behaves like a @for@ loop:
43--
43--
44-- >>> :{
44-- >>> :{
45−-- Stream.fold Fold.toList $ getCrossStream $ do
45+-- Stream.fold Fold.toList $ unCrossStream $ do
46-- x <- CrossStream (Stream.fromList [1,2]) -- foreach x in stream
46-- x <- CrossStream (Stream.fromList [1,2]) -- foreach x in stream
47-- return x
47-- return x
48-- :}
48-- :}
@@ -51,14 +51,14 @@ import qualified Streamly.Internal.Data.Stream.StreamK.Type as K
51-- Nested monad binds behave like nested @for@ loops:
51-- Nested monad binds behave like nested @for@ loops:
52--
52--
53-- >>> :{
53-- >>> :{
54−-- Stream.fold Fold.toList $ getCrossStream $ do
54+-- Stream.fold Fold.toList $ unCrossStream $ do
55-- x <- CrossStream (Stream.fromList [1,2]) -- foreach x in stream
55-- x <- CrossStream (Stream.fromList [1,2]) -- foreach x in stream
56-- y <- CrossStream (Stream.fromList [3,4]) -- foreach y in stream
56-- y <- CrossStream (Stream.fromList [3,4]) -- foreach y in stream
57-- return (x, y)
57-- return (x, y)
58-- :}
58-- :}
59-- [(1,3),(1,4),(2,3),(2,4)]
59-- [(1,3),(1,4),(2,3),(2,4)]
60--
60--
61−newtype CrossStream m a = CrossStream {getCrossStream :: Stream m a}
61+newtype CrossStream m a = CrossStream {unCrossStream :: Stream m a}
62 deriving (Functor, Semigroup, Monoid, Foldable)
62 deriving (Functor, Semigroup, Monoid, Foldable)
63
63
64-- Pure (Identity monad) stream instances
64-- Pure (Identity monad) stream instances
@@ -122,7 +122,7 @@ instance Monad m => Monad (CrossStream m) where
122 $ K.bindWith
122 $ K.bindWith
123 K.serial
123 K.serial
124 (Stream.toStreamK m)
124 (Stream.toStreamK m)
125− (Stream.toStreamK . getCrossStream . f))
125+ (Stream.toStreamK . unCrossStream . f))
126
126
127 {-# INLINE (>>) #-}
127 {-# INLINE (>>) #-}
128 (>>) = (*>)
128 (>>) = (*>)
core/src/Streamly/Internal/Data/Stream/Generate.hs+1−1
@@ -373,7 +373,7 @@ iterateM step = fromStreamD . D.iterateM step
373-- >>> :{
373-- >>> :{
374-- main = Stream.fold (Fold.drainMapM print) $ Stream.mfix f
374-- main = Stream.fold (Fold.drainMapM print) $ Stream.mfix f
375-- where
375-- where
376−-- f action = getCrossStream $ do
376+-- f action = unCrossStream $ do
377-- let incr n act = fmap ((+n) . snd) $ unsafeInterleaveIO act
377-- let incr n act = fmap ((+n) . snd) $ unsafeInterleaveIO act
378-- x <- CrossStream (Stream.sequence $ Stream.fromList [incr 1 action, incr 2 action])
378-- x <- CrossStream (Stream.sequence $ Stream.fromList [incr 1 action, incr 2 action])
379-- y <- CrossStream (Stream.fromList [4,5])
379-- y <- CrossStream (Stream.fromList [4,5])
core/src/Streamly/Internal/Data/Stream/Top.hs+3−3
@@ -162,7 +162,7 @@ sortBy cmp =
162-- /Pre-release/
162-- /Pre-release/
163{-# INLINE crossJoin #-}
163{-# INLINE crossJoin #-}
164crossJoin :: Monad m => Stream m a -> Stream m b -> Stream m (a, b)
164crossJoin :: Monad m => Stream m a -> Stream m b -> Stream m (a, b)
165−crossJoin s1 s2 = getCrossStream $ do
165+crossJoin s1 s2 = unCrossStream $ do
166 -- XXX use concatMap instead?
166 -- XXX use concatMap instead?
167 a <- CrossStream s1
167 a <- CrossStream s1
168 b <- CrossStream s2
168 b <- CrossStream s2
@@ -245,7 +245,7 @@ joinInnerMerge = undefined
245{-# INLINE joinLeft #-}
245{-# INLINE joinLeft #-}
246joinLeft :: Monad m =>
246joinLeft :: Monad m =>
247 (a -> b -> Bool) -> Stream m a -> Stream m b -> Stream m (a, Maybe b)
247 (a -> b -> Bool) -> Stream m a -> Stream m b -> Stream m (a, Maybe b)
248−joinLeft eq s1 s2 = Stream.evalStateT (return False) $ getCrossStream $ do
248+joinLeft eq s1 s2 = Stream.evalStateT (return False) $ unCrossStream $ do
249 a <- CrossStream (Stream.liftInner s1)
249 a <- CrossStream (Stream.liftInner s1)
250 -- XXX should we use StreamD monad here?
250 -- XXX should we use StreamD monad here?
251 -- XXX Is there a better way to perform some action at the end of a loop
251 -- XXX Is there a better way to perform some action at the end of a loop
@@ -322,7 +322,7 @@ joinOuter eq s1 s =
322 ) stream1 stream2
322 ) stream1 stream2
323 ) & Stream.catMaybes
323 ) & Stream.catMaybes
324
324
325− evalState = Stream.evalStateT (return False) . getCrossStream
325+ evalState = Stream.evalStateT (return False) . unCrossStream
326
326
327 go inputArr foundArr = evalState $ do
327 go inputArr foundArr = evalState $ do
328 a <- CrossStream (Stream.liftInner s1)
328 a <- CrossStream (Stream.liftInner s1)
docs/User/Tutorials/ConcurrentStreams.hs+2−2
@@ -710,7 +710,7 @@ import Control.Monad.Trans.Class (MonadTrans (lift))
710-- 'fromZipAsync' type combinator can be used to switch to parallel applicative
710-- 'fromZipAsync' type combinator can be used to switch to parallel applicative
711-- zip composition:
711-- zip composition:
712--
712--
713−-- >>> d n = getCrossStream (CrossStream (delay n) >> return n)
713+-- >>> d n = unCrossStream (CrossStream (delay n) >> return n)
714-- >>> s1 = Stream.fromSerial $ d 2 <> d 4
714-- >>> s1 = Stream.fromSerial $ d 2 <> d 4
715-- >>> s2 = Stream.fromSerial $ d 3 <> d 1
715-- >>> s2 = Stream.fromSerial $ d 3 <> d 1
716-- >>> (Stream.toList $ Stream.fromZipAsync $ (,) <$> s1 <*> s2) >>= print
716-- >>> (Stream.toList $ Stream.fromZipAsync $ (,) <$> s1 <*> s2) >>= print
@@ -746,7 +746,7 @@ import Control.Monad.Trans.Class (MonadTrans (lift))
746-- main = do
746-- main = do
747-- z <- Stream.toList
747-- z <- Stream.toList
748-- $ Stream.fromSerial -- Serial monadic processing (sqrt below)
748-- $ Stream.fromSerial -- Serial monadic processing (sqrt below)
749−-- $ getCrossStream $ do
749+-- $ unCrossStream $ do
750-- -- Concurrent @"for"@ loop
750-- -- Concurrent @"for"@ loop
751-- x2 <- CrossStream (Stream.concatForFoldableWith Stream.async [1..100] $
751-- x2 <- CrossStream (Stream.concatForFoldableWith Stream.async [1..100] $
752-- \x -> Stream.fromPure $ x * x) -- body of the loop
752-- \x -> Stream.fromPure $ x * x) -- body of the loop
docs/User/Tutorials/Tutorial.hs+5−5
@@ -355,7 +355,7 @@ import Control.Monad.Trans.Class (MonadTrans (lift))
355-- instead.
355-- instead.
356--
356--
357-- >>> :{
357-- >>> :{
358−-- Stream.drain $ getCrossStream $ do
358+-- Stream.drain $ unCrossStream $ do
359-- x <- CrossStream (Stream.fromFoldable [3,2,1])
359-- x <- CrossStream (Stream.fromFoldable [3,2,1])
360-- CrossStream (Stream.fromEffect $ print x)
360-- CrossStream (Stream.fromEffect $ print x)
361-- :}
361-- :}
@@ -373,7 +373,7 @@ import Control.Monad.Trans.Class (MonadTrans (lift))
373--
373--
374-- >>> :{
374-- >>> :{
375-- main =
375-- main =
376−-- Stream.drain $ getCrossStream $ do
376+-- Stream.drain $ unCrossStream $ do
377-- x <- CrossStream (Stream.repeatM getLine)
377-- x <- CrossStream (Stream.repeatM getLine)
378-- CrossStream (Stream.fromEffect $ putStrLn x)
378-- CrossStream (Stream.fromEffect $ putStrLn x)
379-- :}
379-- :}
@@ -382,7 +382,7 @@ import Control.Monad.Trans.Class (MonadTrans (lift))
382-- manner:
382-- manner:
383--
383--
384-- >>> :{
384-- >>> :{
385−-- Stream.drain $ getCrossStream $ do
385+-- Stream.drain $ unCrossStream $ do
386-- x <- CrossStream (Stream.fromFoldable [1,2])
386-- x <- CrossStream (Stream.fromFoldable [1,2])
387-- y <- CrossStream (Stream.fromFoldable [3,4])
387-- y <- CrossStream (Stream.fromFoldable [3,4])
388-- CrossStream (Stream.fromEffect $ print (x, y))
388-- CrossStream (Stream.fromEffect $ print (x, y))
@@ -429,7 +429,7 @@ import Control.Monad.Trans.Class (MonadTrans (lift))
429--
429--
430-- >>> :{
430-- >>> :{
431-- composed :: Stream IO ()
431-- composed :: Stream IO ()
432−-- composed = getCrossStream $ do
432+-- composed = unCrossStream $ do
433-- sz <- CrossStream sizes
433-- sz <- CrossStream sizes
434-- cl <- CrossStream colors
434-- cl <- CrossStream colors
435-- sh <- CrossStream shapes
435-- sh <- CrossStream shapes
@@ -466,7 +466,7 @@ import Control.Monad.Trans.Class (MonadTrans (lift))
466-- >>> s1 = p 1 <> p 2
466-- >>> s1 = p 1 <> p 2
467-- >>> s2 = p 3 <> p 4
467-- >>> s2 = p 3 <> p 4
468--
468--
469−-- >>> (Stream.toList $ getCrossStream $ (,) <$> CrossStream s1 <*> CrossStream s2) >>= print
469+-- >>> (Stream.toList $ unCrossStream $ (,) <$> CrossStream s1 <*> CrossStream s2) >>= print
470-- 1
470-- 1
471-- 3
471-- 3
472-- 4
472-- 4