@@ -1,3 +1,4 @@
1{-# LANGUAGE UndecidableInstances #-}
2{-# LANGUAGE UndecidableInstances #-}
3-- Module : Streamly.Internal.Data.Stream.StreamK.Type
4-- Module : Streamly.Internal.Data.Stream.StreamK.Type
@@ -163,15 +164,7 @@ import qualified Prelude
163import Prelude hiding
164import Prelude hiding
164 (map, mapM, concatMap, foldr, repeat, null, reverse, tail, init)
165 (map, mapM, concatMap, foldr, repeat, null, reverse, tail, init)
166−-- $setup
167+#include "DocTestDataStreamK.hs"
167−-- >>> import Data.Function (fix, (&))
168−-- >>> import Data.Semigroup (cycle1)
169−-- >>> import Streamly.Internal.Data.Stream.StreamK (CrossStreamK(..))
170−-- >>> import qualified Streamly.Data.Fold as Fold
171−-- >>> import qualified Streamly.Data.Stream as Stream
172−-- >>> import qualified Streamly.Data.StreamK as StreamK
173−-- >>> import qualified Streamly.Internal.Data.Stream.StreamK as StreamK
174−-- >>> import qualified Streamly.Internal.FileSystem.Dir as Dir
176------------------------------------------------------------------------------
169------------------------------------------------------------------------------
177-- Basic stream type
170-- Basic stream type
@@ -315,7 +308,7 @@ nilM m = mkStream $ \_ _ _ stp -> m *> stp
316-- | Create a singleton stream from a pure value.
309-- | Create a singleton stream from a pure value.
318−-- >>> fromPure a = a `cons` StreamK.nil
311+-- >>> fromPure a = a `StreamK.cons` StreamK.nil
319-- >>> fromPure = pure
312-- >>> fromPure = pure
320-- >>> fromPure = StreamK.fromEffect . pure
313-- >>> fromPure = StreamK.fromEffect . pure
@@ -325,7 +318,7 @@ fromPure a = mkStream $ \_ _ single _ -> single a
326-- | Create a singleton stream from a monadic action.
319-- | Create a singleton stream from a monadic action.
328−-- >>> fromEffect m = m `consM` StreamK.nil
321+-- >>> fromEffect m = m `StreamK.consM` StreamK.nil
330-- >>> Stream.fold Fold.drain $ StreamK.toStream $ StreamK.fromEffect (putStrLn "hello")
323-- >>> Stream.fold Fold.drain $ StreamK.toStream $ StreamK.fromEffect (putStrLn "hello")
@@ -343,7 +336,7 @@ infixr 5 `consM`
343-- | A right associative prepend operation to add an effectful value at the
336-- | A right associative prepend operation to add an effectful value at the
344-- head of an existing stream::
337-- head of an existing stream::
346−-- >>> s = putStrLn "hello" `consM` putStrLn "world" `consM` StreamK.nil
339+-- >>> s = putStrLn "hello" `StreamK.consM` putStrLn "world" `StreamK.consM` StreamK.nil
347-- >>> Stream.fold Fold.drain (StreamK.toStream s)
340-- >>> Stream.fold Fold.drain (StreamK.toStream s)