on master help sign in
Create an IsStream/Types module for stream types
b164f68Harendra Kumar
src/Streamly/Internal/Data/Stream/IsStream.hs+11−29
@@ -1,21 +1,14 @@
1−{-# OPTIONS_GHC -Wno-orphans #-}
2−
3−#include "inline.hs"
4−
5-- |
1-- |
6-- Module : Streamly.Internal.Data.Stream.IsStream
2-- Module : Streamly.Internal.Data.Stream.IsStream
7-- Copyright : (c) 2017 Composewell Technologies
3-- Copyright : (c) 2017 Composewell Technologies
8−--
9−-- License : BSD3
4+-- License : BSD-3-Clause
10-- Maintainer : streamly@composewell.com
5-- Maintainer : streamly@composewell.com
11-- Stability : experimental
6-- Stability : experimental
12-- Portability : GHC
7-- Portability : GHC
13--
8--
14−-- This is an Internal module consisting of released, unreleased and
9+-- This is an internal module which is superset of the corresponding released
15−-- unimplemented APIs. For stable and released APIs please see
10+-- module "Streamly.Prelude". It contains some additional unreleased or
16−-- "Streamly.Prelude" module. This module provides documentation only for the
11+-- experimental APIs.
17−-- unreleased and unimplemented APIs. For documentation on released APIs please
18−-- see "Streamly.Prelude" module.
19
12
20module Streamly.Internal.Data.Stream.IsStream
13module Streamly.Internal.Data.Stream.IsStream
21 (
14 (
@@ -598,36 +591,25 @@ module Streamly.Internal.Data.Stream.IsStream
598 )
591 )
599where
592where
600
593
601−import Streamly.Internal.Data.SVar (MonadAsync, Rate (..))
594+import Streamly.Internal.Data.SVar (Rate (..))
602−import Streamly.Internal.Data.Stream.Ahead (AheadT, Ahead, aheadly)
603−import Streamly.Internal.Data.Stream.Async
604− ( AsyncT, Async, WAsyncT, WAsync, mkAsync, asyncly
605− , wAsyncly)
606import Streamly.Internal.Data.Stream.Combinators
595import Streamly.Internal.Data.Stream.Combinators
607 ( inspectMode, maxBuffer, maxThreads, rate, avgRate, minRate
596 ( inspectMode, maxBuffer, maxThreads, rate, avgRate, minRate
608 , maxRate, constRate)
597 , maxRate, constRate)
609−import Streamly.Internal.Data.Stream.Parallel
610− ( ParallelT, Parallel, parallely)
611−import Streamly.Internal.Data.Stream.StreamK (IsStream(), adapt)
612−import Streamly.Internal.Data.Stream.Serial
613− ( SerialT, WSerialT, Serial, WSerial, serially
614− , wSerially)
615−import Streamly.Internal.Data.Stream.Zip
616− ( ZipSerialM, ZipSerial, ZipAsyncM, ZipAsync, zipSerially, zipAsyncly)
617
598
599+import qualified Streamly.Internal.Data.Stream.Parallel as Par
618import qualified Streamly.Internal.Data.Stream.Prelude as P
600import qualified Streamly.Internal.Data.Stream.Prelude as P
619−import qualified Streamly.Internal.Data.Stream.StreamK as K
620import qualified Streamly.Internal.Data.Stream.StreamD as D
601import qualified Streamly.Internal.Data.Stream.StreamD as D
602+import qualified Streamly.Internal.Data.Stream.StreamK as K
621import qualified Streamly.Internal.Data.Stream.Serial as Serial
603import qualified Streamly.Internal.Data.Stream.Serial as Serial
622−import qualified Streamly.Internal.Data.Stream.Parallel as Par
623import qualified Streamly.Internal.Data.Stream.Zip as Z
604import qualified Streamly.Internal.Data.Stream.Zip as Z
624
605
625−import Streamly.Internal.Data.Stream.IsStream.Generate
626import Streamly.Internal.Data.Stream.IsStream.Eliminate
606import Streamly.Internal.Data.Stream.IsStream.Eliminate
627−import Streamly.Internal.Data.Stream.IsStream.Transform
628−import Streamly.Internal.Data.Stream.IsStream.Nesting
629import Streamly.Internal.Data.Stream.IsStream.Exception
607import Streamly.Internal.Data.Stream.IsStream.Exception
608+import Streamly.Internal.Data.Stream.IsStream.Generate
630import Streamly.Internal.Data.Stream.IsStream.Lift
609import Streamly.Internal.Data.Stream.IsStream.Lift
610+import Streamly.Internal.Data.Stream.IsStream.Nesting
611+import Streamly.Internal.Data.Stream.IsStream.Transform
612+import Streamly.Internal.Data.Stream.IsStream.Types
631
613
632import Prelude hiding
614import Prelude hiding
633 ( filter, drop, dropWhile, take, takeWhile, zipWith, foldr
615 ( filter, drop, dropWhile, take, takeWhile, zipWith, foldr
src/Streamly/Internal/Data/Stream/IsStream/Types.hsnew file+74
@@ -0,0 +1,74 @@
1+-- |
2+-- Module : Streamly.Internal.Data.Stream.IsStream
3+-- Copyright : (c) 2017 Composewell Technologies
4+-- License : BSD-3-Clause
5+-- Maintainer : streamly@composewell.com
6+-- Stability : experimental
7+-- Portability : GHC
8+--
9+-- | This module contains different stream types and combinators to
10+-- interconvert between them.
11+
12+module Streamly.Internal.Data.Stream.IsStream.Types
13+ (
14+ -- * Stream Types
15+ -- ** Serial Streams
16+ SerialT
17+ , Serial
18+ , WSerialT
19+ , WSerial
20+
21+ -- ** Speculative Streams
22+ , AheadT
23+ , Ahead
24+
25+ -- ** Asynchronous Streams
26+ , AsyncT
27+ , Async
28+ , WAsyncT
29+ , WAsync
30+
31+ -- ** Parallel Streams
32+ -- | Ahead, Async and WAsync schedule actions concurrently on demand.
33+ -- Unlike those 'Parallel' streams schedule all actions concurrently
34+ -- upfront.
35+ , ParallelT
36+ , Parallel
37+ , mkAsync
38+
39+ -- ** Zipping Streams
40+ , ZipSerialM
41+ , ZipSerial
42+ , ZipAsyncM
43+ , ZipAsync
44+
45+ -- * Stream Type Adapters
46+ , IsStream ()
47+
48+ , serially
49+ , wSerially
50+ , asyncly
51+ , aheadly
52+ , wAsyncly
53+ , parallely
54+ , zipSerially
55+ , zipAsyncly
56+ , adapt
57+
58+ -- * Type Synonyms
59+ , MonadAsync
60+ )
61+where
62+
63+import Streamly.Internal.Data.Stream.Ahead (AheadT, Ahead, aheadly)
64+import Streamly.Internal.Data.Stream.Async
65+ ( AsyncT, Async, WAsyncT, WAsync, mkAsync, asyncly
66+ , wAsyncly)
67+import Streamly.Internal.Data.Stream.Parallel (ParallelT, Parallel, parallely)
68+import Streamly.Internal.Data.Stream.Serial
69+ ( SerialT, WSerialT, Serial, WSerial, serially
70+ , wSerially)
71+import Streamly.Internal.Data.Stream.StreamK (IsStream(), adapt)
72+import Streamly.Internal.Data.Stream.Zip
73+ (ZipSerialM, ZipSerial, ZipAsyncM, ZipAsync, zipSerially, zipAsyncly)
74+import Streamly.Internal.Data.SVar (MonadAsync)
streamly.cabal+1
@@ -473,6 +473,7 @@ library
473 , Streamly.Internal.Data.Stream.Zip
473 , Streamly.Internal.Data.Stream.Zip
474 , Streamly.Internal.Data.Stream.Combinators
474 , Streamly.Internal.Data.Stream.Combinators
475 , Streamly.Internal.Data.Stream.IsStream.Common
475 , Streamly.Internal.Data.Stream.IsStream.Common
476+ , Streamly.Internal.Data.Stream.IsStream.Types
476 , Streamly.Internal.Data.Stream.IsStream.Generate
477 , Streamly.Internal.Data.Stream.IsStream.Generate
477 , Streamly.Internal.Data.Stream.IsStream.Eliminate
478 , Streamly.Internal.Data.Stream.IsStream.Eliminate
478 , Streamly.Internal.Data.Stream.IsStream.Transform
479 , Streamly.Internal.Data.Stream.IsStream.Transform