on master help sign in
Remove 0.6.x or beofre Deprecated functions
commit7e82570e849aa351638be6cbd3fc293d3b8cab85 authorRanjeet Kumar Ranjan <ranjeetr@composewell.com> dateWed 23 Mar 2022, 12:26 (5 years ago) parentddfe6bd
10 files changed−240
core/src/Streamly/Internal/Data/Stream/Serial.hs−14 core/src/Streamly/Internal/Data/Stream/Zip.hs−8 core/src/Streamly/Internal/Data/Time.hs−74 core/streamly-core.cabal−1 src/Streamly.hs−67 src/Streamly/Internal/Data/Stream/IsStream/Expand.hs−20 src/Streamly/Internal/Data/Stream/IsStream/Generate.hs−18 src/Streamly/Internal/Data/Stream/IsStream/Type.hs−34 src/Streamly/Prelude.hs−2 streamly.cabal−2
core/src/Streamly/Internal/Data/Stream/Serial.hs−14
@@ -43,10 +43,6 @@ module Streamly.Internal.Data.Stream.Serial
4343 , map
4444 , mapM
4545 , foldFilter
46−
47− -- * Deprecated
48− , StreamT
49− , InterleavedT
5046 )
5147where
5248
@@ -137,11 +133,6 @@ newtype SerialT m a = SerialT {getSerialT :: Stream m a}
137133-- @since 0.8.0
138134type Serial = SerialT IO
139135
140−-- |
141−-- @since 0.1.0
142−{-# DEPRECATED StreamT "Please use 'SerialT' instead." #-}
143−type StreamT = SerialT
144−
145136------------------------------------------------------------------------------
146137-- Generation
147138------------------------------------------------------------------------------
@@ -337,11 +328,6 @@ newtype WSerialT m a = WSerialT {getWSerialT :: Stream m a}
337328-- @since 0.8.0
338329type WSerial = WSerialT IO
339330
340−-- |
341−-- @since 0.1.0
342−{-# DEPRECATED InterleavedT "Please use 'WSerialT' instead." #-}
343−type InterleavedT = WSerialT
344−
345331{-# INLINE consMWSerial #-}
346332{-# SPECIALIZE consMWSerial :: IO a -> WSerialT IO a -> WSerialT IO a #-}
347333consMWSerial :: Monad m => m a -> WSerialT m a -> WSerialT m a
core/src/Streamly/Internal/Data/Stream/Zip.hs−8
@@ -20,9 +20,6 @@ module Streamly.Internal.Data.Stream.Zip
2020 , consMZip
2121 , zipWithK
2222 , zipWithMK
23−
24− -- * Deprecated
25− , ZipStream
2623 )
2724where
2825
@@ -103,11 +100,6 @@ zipWithK f = zipWithMK (\a b -> return (f a b))
103100newtype ZipSerialM m a = ZipSerialM {getZipSerialM :: Stream m a}
104101 deriving (Semigroup, Monoid)
105102
106−-- |
107−-- @since 0.1.0
108−{-# DEPRECATED ZipStream "Please use 'ZipSerialM' instead." #-}
109−type ZipStream = ZipSerialM
110−
111103-- | An IO stream whose applicative instance zips streams serially.
112104--
113105-- /Since: 0.2.0 ("Streamly")/
core/src/Streamly/Internal/Data/Time.hsdeleted−74
@@ -1,74 +0,0 @@
1−-- |
2−-- Module : Streamly.Internal.Data.Time
3−-- Copyright : (c) 2017 Composewell Technologies
4−--
5−-- License : BSD3
6−-- Maintainer : streamly@composewell.com
7−-- Stability : experimental
8−-- Portability : GHC
9−--
10−-- Time utilities for reactive programming.
11−
12−module Streamly.Internal.Data.Time
13−{-# DEPRECATED
14− "Please use the \"rate\" combinator instead of the functions in this module"
15− #-}
16− ( periodic
17− , withClock
18− )
19−where
20−
21−import Control.Monad (when)
22−import Control.Concurrent (threadDelay)
23−
24−-- | Run an action forever periodically at the given frequency specified in per
25−-- second (Hz).
26−--
27−-- @since 0.1.0
28−{-# DEPRECATED periodic "Please use the \"rate\" combinator instead" #-}
29−periodic :: Int -> IO () -> IO ()
30−periodic freq action = do
31− action
32− threadDelay (1000000 `div` freq)
33− periodic freq action
34−
35−-- | Run a computation on every clock tick, the clock runs at the specified
36−-- frequency. It allows running a computation at high frequency efficiently by
37−-- maintaining a local clock and adjusting it with the provided base clock at
38−-- longer intervals. The first argument is a base clock returning some notion
39−-- of time in microseconds. The second argument is the frequency in per second
40−-- (Hz). The third argument is the action to run, the action is provided the
41−-- local time as an argument.
42−--
43−-- @since 0.1.0
44−{-# DEPRECATED withClock "Please use the \"rate\" combinator instead" #-}
45−withClock :: IO Int -> Int -> (Int -> IO ()) -> IO ()
46−withClock clock freq action = do
47− t <- clock
48− go t period period t 0
49−
50− where
51−
52− period = 1000000 `div` freq
53−
54− -- Note that localTime is roughly but not exactly equal to (lastAdj + tick
55− -- * n). That is because we do not abruptly adjust the clock skew instead
56− -- we adjust the tick size.
57− go lastAdj delay tick localTime n = do
58− action localTime
59− when (delay > 0) $ threadDelay delay
60−
61− if n == freq
62− then do
63− (t, newTick, newDelay) <- adjustClock lastAdj localTime delay
64− go t newDelay newTick (localTime + newTick) 0
65− else go lastAdj delay tick (localTime + tick) (n + 1)
66−
67− -- Adjust the tick size rather than the clock to avoid abrupt changes
68− -- resulting in jittery behavior at the end of every interval.
69− adjustClock lastAdj localTime delay = do
70− baseTime <- clock
71− let newTick = period + (baseTime - localTime) `div` freq
72− lastPeriod = (baseTime - lastAdj) `div` freq
73− newDelay = max 0 (delay + period - lastPeriod)
74− return (baseTime, newTick, newDelay)
core/streamly-core.cabal−1
@@ -233,7 +233,6 @@ library
233233 , Streamly.Internal.Data.IOFinalizer
234234
235235 -- streamly-time
236− , Streamly.Internal.Data.Time
237236 , Streamly.Internal.Data.Time.TimeSpec
238237 , Streamly.Internal.Data.Time.Units
239238 , Streamly.Internal.Data.Time.Clock.Type
src/Streamly.hs−67
@@ -189,23 +189,7 @@ module Streamly {-# DEPRECATED "Please use \"Streamly.Prelude\" instead." #-}
189189 -- * Re-exports
190190 , Semigroup (..)
191191 -- * Deprecated
192− , Streaming
193192 , runStream
194− , runStreaming
195− , runStreamT
196− , runInterleavedT
197− , runAsyncT
198− , runParallelT
199− , runZipStream
200− , runZipAsync
201− , StreamT
202− , InterleavedT
203− , ZipStream
204− , interleaving
205− , zipping
206− , zippingAsync
207− , (<=>)
208− , (<|)
209193 )
210194where
211195
@@ -217,8 +201,6 @@ import Streamly.Internal.Data.Stream.Async
217201import Streamly.Internal.Data.Stream.IsStream.Combinators
218202import Streamly.Internal.Data.Stream.IsStream.Expand
219203import Streamly.Internal.Data.Stream.IsStream.Type
220−import Streamly.Internal.Data.Stream.Serial (StreamT, InterleavedT)
221−import Streamly.Internal.Data.Stream.Zip
222204
223205import qualified Streamly.Prelude as P
224206import qualified Streamly.Internal.Data.Stream.IsStream as IP
@@ -358,61 +340,12 @@ import qualified Streamly.Internal.Data.Stream.IsStream.Transform as Transform
358340-- Eliminating a stream
359341------------------------------------------------------------------------------
360342
361−-- | Same as 'runStream'
362−--
363−-- @since 0.1.0
364−{-# DEPRECATED runStreaming "Please use runStream instead." #-}
365−runStreaming :: (Monad m, IsStream t) => t m a -> m ()
366−runStreaming = P.drain . adapt
367−
368−-- | Same as @runStream@.
369−--
370−-- @since 0.1.0
371−{-# DEPRECATED runStreamT "Please use runStream instead." #-}
372−runStreamT :: Monad m => SerialT m a -> m ()
373−runStreamT = P.drain
374−
375343-- | Same as "Streamly.Prelude.runStream".
376344--
377345{-# DEPRECATED runStream "Please use Streamly.Prelude.drain instead." #-}
378346runStream :: Monad m => SerialT m a -> m ()
379347runStream = P.drain
380348
381−-- | Same as @drain . fromWSerial@.
382−--
383−-- @since 0.1.0
384−{-# DEPRECATED runInterleavedT "Please use 'drain . interleaving' instead." #-}
385−runInterleavedT :: Monad m => WSerialT m a -> m ()
386−runInterleavedT = P.drain . adapt
387−
388−-- | Same as @drain . fromParallel@.
389−--
390−-- @since 0.1.0
391−{-# DEPRECATED runParallelT "Please use 'drain . fromParallel' instead." #-}
392−runParallelT :: Monad m => ParallelT m a -> m ()
393−runParallelT = P.drain . adapt
394−
395−-- | Same as @drain . fromAsync@.
396−--
397−-- @since 0.1.0
398−{-# DEPRECATED runAsyncT "Please use 'drain . fromAsync' instead." #-}
399−runAsyncT :: Monad m => AsyncT m a -> m ()
400−runAsyncT = P.drain . adapt
401−
402−-- | Same as @drain . zipping@.
403−--
404−-- @since 0.1.0
405−{-# DEPRECATED runZipStream "Please use 'drain . fromZipSerial instead." #-}
406−runZipStream :: Monad m => ZipSerialM m a -> m ()
407−runZipStream = P.drain . adapt
408−
409−-- | Same as @drain . zippingAsync@.
410−--
411−-- @since 0.1.0
412−{-# DEPRECATED runZipAsync "Please use 'drain . fromZipAsync instead." #-}
413−runZipAsync :: Monad m => ZipAsyncM m a -> m ()
414−runZipAsync = P.drain . adapt
415−
416349{-
417350-- | Same as "Streamly.Prelude.foldWith".
418351--
src/Streamly/Internal/Data/Stream/IsStream/Expand.hs−20
@@ -158,8 +158,6 @@ module Streamly.Internal.Data.Stream.IsStream.Expand
158158
159159 -- * Deprecated
160160 , concatUnfold
161− , (<=>)
162− , (<|)
163161 )
164162where
165163
@@ -289,16 +287,6 @@ infixr 6 `wSerial`
289287wSerial :: IsStream t => t m a -> t m a -> t m a
290288wSerial m1 m2 = fromStream $ Serial.wSerialK (toStream m1) (toStream m2)
291289
292−infixr 5 <=>
293−
294−-- | Same as 'wSerial'.
295−--
296−-- @since 0.1.0
297−{-# DEPRECATED (<=>) "Please use 'wSerial' instead." #-}
298−{-# INLINE (<=>) #-}
299−(<=>) :: IsStream t => t m a -> t m a -> t m a
300−(<=>) = wSerial
301−
302290-- XXX Same as 'wSerial'. We should perhaps rename wSerial to interleave.
303291-- XXX Document the interleaving behavior of side effects in all the
304292-- interleaving combinators.
@@ -485,14 +473,6 @@ infixr 6 `async`
485473async :: (IsStream t, MonadAsync m) => t m a -> t m a -> t m a
486474async m1 m2 = fromStream $ asyncK (toStream m1) (toStream m2)
487475
488−-- | Same as 'async'.
489−--
490−-- @since 0.1.0
491−{-# DEPRECATED (<|) "Please use 'async' instead." #-}
492−{-# INLINE (<|) #-}
493−(<|) :: (IsStream t, MonadAsync m) => t m a -> t m a -> t m a
494−(<|) = async
495−
496476infixr 6 `wAsync`
497477
498478-- | For singleton streams, 'wAsync' is the same as 'async'. See 'async' for
src/Streamly/Internal/Data/Stream/IsStream/Generate.hs−18
@@ -79,10 +79,8 @@ module Streamly.Internal.Data.Stream.IsStream.Generate
7979 , fromPrimIORef
8080
8181 -- * Deprecated
82− , once
8382 , yield
8483 , yieldM
85− , each
8684 , fromHandle
8785 , currentTime
8886 )
@@ -624,14 +622,6 @@ fromListM = fromFoldableM
624622fromListMSerial :: MonadAsync m => [m a] -> SerialT m a
625623fromListMSerial = fromStreamD . D.fromListM
626624
627−-- | Same as 'fromFoldable'.
628−--
629−-- @since 0.1.0
630−{-# DEPRECATED each "Please use fromFoldable instead." #-}
631−{-# INLINE each #-}
632−each :: (IsStream t, Foldable f) => f a -> t m a
633−each = fromFoldable
634−
635625-- | Read lines from an IO Handle into a stream of Strings.
636626--
637627-- @since 0.1.0
@@ -670,11 +660,3 @@ fromCallback setCallback = concatM $ do
670660{-# INLINE fromPrimIORef #-}
671661fromPrimIORef :: (IsStream t, MonadIO m, Prim a) => Prim.IORef a -> t m a
672662fromPrimIORef = fromStreamD . Prim.toStreamD
673−
674−-- | Same as fromEffect
675−--
676−-- @since 0.2.0
677−{-# DEPRECATED once "Please use fromEffect instead." #-}
678−{-# INLINE once #-}
679−once :: (Monad m, IsStream t) => m a -> t m a
680−once = IsStream.fromEffect
src/Streamly/Internal/Data/Stream/IsStream/Type.hs−34
@@ -15,7 +15,6 @@ module Streamly.Internal.Data.Stream.IsStream.Type
1515 -- * IsStream Type Class
1616 IsStream (..)
1717 , K.Stream (..)
18− , Streaming
1918
2019 -- * Type Conversion
2120 , fromStreamS
@@ -101,11 +100,6 @@ module Streamly.Internal.Data.Stream.IsStream.Type
101100 -- * Zip style operations
102101 , eqBy
103102 , cmpBy
104−
105− -- * Deprecated
106− , interleaving
107− , zipping
108− , zippingAsync
109103 )
110104where
111105
@@ -205,12 +199,6 @@ class
205199 -- We can define (|:) just as 'consM' but it is defined explicitly for each
206200 -- type because we want to use SPECIALIZE pragma on the definition.
207201
208−-- | Same as 'IsStream'.
209−--
210−-- @since 0.1.0
211−{-# DEPRECATED Streaming "Please use IsStream instead." #-}
212−type Streaming = IsStream
213−
214202-------------------------------------------------------------------------------
215203-- Type adapting combinators
216204-------------------------------------------------------------------------------
@@ -494,13 +482,6 @@ instance IsStream SerialT where
494482fromWSerial :: IsStream t => WSerialT m a -> t m a
495483fromWSerial = adapt
496484
497−-- | Same as 'fromWSerial'.
498−--
499−-- @since 0.1.0
500−{-# DEPRECATED interleaving "Please use fromWSerial instead." #-}
501−interleaving :: IsStream t => WSerialT m a -> t m a
502−interleaving = fromWSerial
503−
504485instance IsStream WSerialT where
505486 toStream = getWSerialT
506487 fromStream = WSerialT
@@ -618,14 +599,6 @@ instance IsStream ParallelT where
618599-- @since 0.8.0
619600fromZipSerial :: IsStream t => ZipSerialM m a -> t m a
620601fromZipSerial = adapt
621−
622−-- | Same as 'fromZipSerial'.
623−--
624−-- @since 0.1.0
625−{-# DEPRECATED zipping "Please use fromZipSerial instead." #-}
626−zipping :: IsStream t => ZipSerialM m a -> t m a
627−zipping = fromZipSerial
628−
629602instance IsStream ZipSerialM where
630603 toStream = getZipSerialM
631604 fromStream = ZipSerialM
@@ -648,13 +621,6 @@ instance IsStream ZipSerialM where
648621fromZipAsync :: IsStream t => ZipAsyncM m a -> t m a
649622fromZipAsync = adapt
650623
651−-- | Same as 'fromZipAsync'.
652−--
653−-- @since 0.1.0
654−{-# DEPRECATED zippingAsync "Please use fromZipAsync instead." #-}
655−zippingAsync :: IsStream t => ZipAsyncM m a -> t m a
656−zippingAsync = fromZipAsync
657−
658624instance IsStream ZipAsyncM where
659625 toStream = getZipAsyncM
660626 fromStream = ZipAsyncM
src/Streamly/Prelude.hs−2
@@ -919,10 +919,8 @@ module Streamly.Prelude
919919 , adapt
920920
921921 -- * Deprecated
922− , once
923922 , yield
924923 , yieldM
925− , each
926924 , scanx
927925 , foldx
928926 , foldxM
streamly.cabal−2
@@ -150,7 +150,6 @@ extra-source-files:
150150 core/src/Streamly/Internal/Control/Concurrent.hs
151151 core/src/Streamly/Internal/Control/ForkLifted.hs
152152 core/src/Streamly/Internal/Data/IOFinalizer.hs
153− core/src/Streamly/Internal/Data/Time.hs
154153 core/src/Streamly/Internal/Data/Time/TimeSpec.hsc
155154 core/src/Streamly/Internal/Data/Time/Units.hs
156155 core/src/Streamly/Internal/Data/Time/Clock/Type.hsc
@@ -529,7 +528,6 @@ library
529528 , Streamly.Internal.Data.IOFinalizer
530529
531530 -- streamly-time
532− , Streamly.Internal.Data.Time
533531 , Streamly.Internal.Data.Time.TimeSpec
534532 , Streamly.Internal.Data.Time.Units
535533 , Streamly.Internal.Data.Time.Clock.Type