on master help sign in
Create an IsStream/Types module for stream types
commitb164f688299c91d8721dbd510984adfa65dd4d87 authorHarendra Kumar <harendra@composewell.com> dateSat 16 Jan 2021, 19:30 (6 years ago) parent0e2de7f
3 files changed+86−29
src/Streamly/Internal/Data/Stream/IsStream.hs+11−29 src/Streamly/Internal/Data/Stream/IsStream/Types.hs+74 streamly.cabal+1
src/Streamly/Internal/Data/Stream/IsStream.hs+11−29
@@ -1,21 +1,14 @@
1−{-# OPTIONS_GHC -Wno-orphans #-}
2−
3−#include "inline.hs"
4−
51-- |
62-- Module : Streamly.Internal.Data.Stream.IsStream
73-- Copyright : (c) 2017 Composewell Technologies
8−--
9−-- License : BSD3
4+-- License : BSD-3-Clause
105-- Maintainer : streamly@composewell.com
116-- Stability : experimental
127-- Portability : GHC
138--
14−-- This is an Internal module consisting of released, unreleased and
15−-- unimplemented APIs. For stable and released APIs please see
16−-- "Streamly.Prelude" module. This module provides documentation only for the
17−-- unreleased and unimplemented APIs. For documentation on released APIs please
18−-- see "Streamly.Prelude" module.
9+-- This is an internal module which is superset of the corresponding released
10+-- module "Streamly.Prelude". It contains some additional unreleased or
11+-- experimental APIs.
1912
2013module Streamly.Internal.Data.Stream.IsStream
2114 (
@@ -598,36 +591,25 @@ module Streamly.Internal.Data.Stream.IsStream
598591 )
599592where
600593
601−import Streamly.Internal.Data.SVar (MonadAsync, 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)
594+import Streamly.Internal.Data.SVar (Rate (..))
606595import Streamly.Internal.Data.Stream.Combinators
607596 ( inspectMode, maxBuffer, maxThreads, rate, avgRate, minRate
608597 , 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)
617598
599+import qualified Streamly.Internal.Data.Stream.Parallel as Par
618600import qualified Streamly.Internal.Data.Stream.Prelude as P
619−import qualified Streamly.Internal.Data.Stream.StreamK as K
620601import qualified Streamly.Internal.Data.Stream.StreamD as D
602+import qualified Streamly.Internal.Data.Stream.StreamK as K
621603import qualified Streamly.Internal.Data.Stream.Serial as Serial
622−import qualified Streamly.Internal.Data.Stream.Parallel as Par
623604import qualified Streamly.Internal.Data.Stream.Zip as Z
624605
625−import Streamly.Internal.Data.Stream.IsStream.Generate
626606import Streamly.Internal.Data.Stream.IsStream.Eliminate
627−import Streamly.Internal.Data.Stream.IsStream.Transform
628−import Streamly.Internal.Data.Stream.IsStream.Nesting
629607import Streamly.Internal.Data.Stream.IsStream.Exception
608+import Streamly.Internal.Data.Stream.IsStream.Generate
630609import 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
631613
632614import Prelude hiding
633615 ( 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
473473 , Streamly.Internal.Data.Stream.Zip
474474 , Streamly.Internal.Data.Stream.Combinators
475475 , Streamly.Internal.Data.Stream.IsStream.Common
476+ , Streamly.Internal.Data.Stream.IsStream.Types
476477 , Streamly.Internal.Data.Stream.IsStream.Generate
477478 , Streamly.Internal.Data.Stream.IsStream.Eliminate
478479 , Streamly.Internal.Data.Stream.IsStream.Transform