on master help sign in
Remove 0.6.x or beofre Deprecated functions
7e82570Ranjeet Kumar Ranjan
core/src/Streamly/Internal/Data/Stream/Serial.hs−14
@@ -43,10 +43,6 @@ module Streamly.Internal.Data.Stream.Serial
43 , map
43 , map
44 , mapM
44 , mapM
45 , foldFilter
45 , foldFilter
46−
47− -- * Deprecated
48− , StreamT
49− , InterleavedT
50 )
46 )
51where
47where
52
48
@@ -137,11 +133,6 @@ newtype SerialT m a = SerialT {getSerialT :: Stream m a}
137-- @since 0.8.0
133-- @since 0.8.0
138type Serial = SerialT IO
134type Serial = SerialT IO
139
135
140−-- |
141−-- @since 0.1.0
142−{-# DEPRECATED StreamT "Please use 'SerialT' instead." #-}
143−type StreamT = SerialT
144−
145------------------------------------------------------------------------------
136------------------------------------------------------------------------------
146-- Generation
137-- Generation
147------------------------------------------------------------------------------
138------------------------------------------------------------------------------
@@ -337,11 +328,6 @@ newtype WSerialT m a = WSerialT {getWSerialT :: Stream m a}
337-- @since 0.8.0
328-- @since 0.8.0
338type WSerial = WSerialT IO
329type WSerial = WSerialT IO
339
330
340−-- |
341−-- @since 0.1.0
342−{-# DEPRECATED InterleavedT "Please use 'WSerialT' instead." #-}
343−type InterleavedT = WSerialT
344−
345{-# INLINE consMWSerial #-}
331{-# INLINE consMWSerial #-}
346{-# SPECIALIZE consMWSerial :: IO a -> WSerialT IO a -> WSerialT IO a #-}
332{-# SPECIALIZE consMWSerial :: IO a -> WSerialT IO a -> WSerialT IO a #-}
347consMWSerial :: Monad m => m a -> WSerialT m a -> WSerialT m a
333consMWSerial :: 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
20 , consMZip
20 , consMZip
21 , zipWithK
21 , zipWithK
22 , zipWithMK
22 , zipWithMK
23−
24− -- * Deprecated
25− , ZipStream
26 )
23 )
27where
24where
28
25
@@ -103,11 +100,6 @@ zipWithK f = zipWithMK (\a b -> return (f a b))
103newtype ZipSerialM m a = ZipSerialM {getZipSerialM :: Stream m a}
100newtype ZipSerialM m a = ZipSerialM {getZipSerialM :: Stream m a}
104 deriving (Semigroup, Monoid)
101 deriving (Semigroup, Monoid)
105
102
106−-- |
107−-- @since 0.1.0
108−{-# DEPRECATED ZipStream "Please use 'ZipSerialM' instead." #-}
109−type ZipStream = ZipSerialM
110−
111-- | An IO stream whose applicative instance zips streams serially.
103-- | An IO stream whose applicative instance zips streams serially.
112--
104--
113-- /Since: 0.2.0 ("Streamly")/
105-- /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
233 , Streamly.Internal.Data.IOFinalizer
233 , Streamly.Internal.Data.IOFinalizer
234
234
235 -- streamly-time
235 -- streamly-time
236− , Streamly.Internal.Data.Time
237 , Streamly.Internal.Data.Time.TimeSpec
236 , Streamly.Internal.Data.Time.TimeSpec
238 , Streamly.Internal.Data.Time.Units
237 , Streamly.Internal.Data.Time.Units
239 , Streamly.Internal.Data.Time.Clock.Type
238 , Streamly.Internal.Data.Time.Clock.Type
src/Streamly.hs−67
@@ -189,23 +189,7 @@ module Streamly {-# DEPRECATED "Please use \"Streamly.Prelude\" instead." #-}
189 -- * Re-exports
189 -- * Re-exports
190 , Semigroup (..)
190 , Semigroup (..)
191 -- * Deprecated
191 -- * Deprecated
192− , Streaming
193 , runStream
192 , 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− , (<|)
209 )
193 )
210where
194where
211
195
@@ -217,8 +201,6 @@ import Streamly.Internal.Data.Stream.Async
217import Streamly.Internal.Data.Stream.IsStream.Combinators
201import Streamly.Internal.Data.Stream.IsStream.Combinators
218import Streamly.Internal.Data.Stream.IsStream.Expand
202import Streamly.Internal.Data.Stream.IsStream.Expand
219import Streamly.Internal.Data.Stream.IsStream.Type
203import Streamly.Internal.Data.Stream.IsStream.Type
220−import Streamly.Internal.Data.Stream.Serial (StreamT, InterleavedT)
221−import Streamly.Internal.Data.Stream.Zip
222
204
223import qualified Streamly.Prelude as P
205import qualified Streamly.Prelude as P
224import qualified Streamly.Internal.Data.Stream.IsStream as IP
206import qualified Streamly.Internal.Data.Stream.IsStream as IP
@@ -358,61 +340,12 @@ import qualified Streamly.Internal.Data.Stream.IsStream.Transform as Transform
358-- Eliminating a stream
340-- Eliminating a stream
359------------------------------------------------------------------------------
341------------------------------------------------------------------------------
360
342
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−
375-- | Same as "Streamly.Prelude.runStream".
343-- | Same as "Streamly.Prelude.runStream".
376--
344--
377{-# DEPRECATED runStream "Please use Streamly.Prelude.drain instead." #-}
345{-# DEPRECATED runStream "Please use Streamly.Prelude.drain instead." #-}
378runStream :: Monad m => SerialT m a -> m ()
346runStream :: Monad m => SerialT m a -> m ()
379runStream = P.drain
347runStream = P.drain
380
348
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−
416{-
349{-
417-- | Same as "Streamly.Prelude.foldWith".
350-- | Same as "Streamly.Prelude.foldWith".
418--
351--
src/Streamly/Internal/Data/Stream/IsStream/Expand.hs−20
@@ -158,8 +158,6 @@ module Streamly.Internal.Data.Stream.IsStream.Expand
158
158
159 -- * Deprecated
159 -- * Deprecated
160 , concatUnfold
160 , concatUnfold
161− , (<=>)
162− , (<|)
163 )
161 )
164where
162where
165
163
@@ -289,16 +287,6 @@ infixr 6 `wSerial`
289wSerial :: IsStream t => t m a -> t m a -> t m a
287wSerial :: IsStream t => t m a -> t m a -> t m a
290wSerial m1 m2 = fromStream $ Serial.wSerialK (toStream m1) (toStream m2)
288wSerial m1 m2 = fromStream $ Serial.wSerialK (toStream m1) (toStream m2)
291
289
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−
302-- XXX Same as 'wSerial'. We should perhaps rename wSerial to interleave.
290-- XXX Same as 'wSerial'. We should perhaps rename wSerial to interleave.
303-- XXX Document the interleaving behavior of side effects in all the
291-- XXX Document the interleaving behavior of side effects in all the
304-- interleaving combinators.
292-- interleaving combinators.
@@ -485,14 +473,6 @@ infixr 6 `async`
485async :: (IsStream t, MonadAsync m) => t m a -> t m a -> t m a
473async :: (IsStream t, MonadAsync m) => t m a -> t m a -> t m a
486async m1 m2 = fromStream $ asyncK (toStream m1) (toStream m2)
474async m1 m2 = fromStream $ asyncK (toStream m1) (toStream m2)
487
475
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−
496infixr 6 `wAsync`
476infixr 6 `wAsync`
497
477
498-- | For singleton streams, 'wAsync' is the same as 'async'. See 'async' for
478-- | 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
79 , fromPrimIORef
79 , fromPrimIORef
80
80
81 -- * Deprecated
81 -- * Deprecated
82− , once
83 , yield
82 , yield
84 , yieldM
83 , yieldM
85− , each
86 , fromHandle
84 , fromHandle
87 , currentTime
85 , currentTime
88 )
86 )
@@ -624,14 +622,6 @@ fromListM = fromFoldableM
624fromListMSerial :: MonadAsync m => [m a] -> SerialT m a
622fromListMSerial :: MonadAsync m => [m a] -> SerialT m a
625fromListMSerial = fromStreamD . D.fromListM
623fromListMSerial = fromStreamD . D.fromListM
626
624
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−
635-- | Read lines from an IO Handle into a stream of Strings.
625-- | Read lines from an IO Handle into a stream of Strings.
636--
626--
637-- @since 0.1.0
627-- @since 0.1.0
@@ -670,11 +660,3 @@ fromCallback setCallback = concatM $ do
670{-# INLINE fromPrimIORef #-}
660{-# INLINE fromPrimIORef #-}
671fromPrimIORef :: (IsStream t, MonadIO m, Prim a) => Prim.IORef a -> t m a
661fromPrimIORef :: (IsStream t, MonadIO m, Prim a) => Prim.IORef a -> t m a
672fromPrimIORef = fromStreamD . Prim.toStreamD
662fromPrimIORef = 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
15 -- * IsStream Type Class
15 -- * IsStream Type Class
16 IsStream (..)
16 IsStream (..)
17 , K.Stream (..)
17 , K.Stream (..)
18− , Streaming
19
18
20 -- * Type Conversion
19 -- * Type Conversion
21 , fromStreamS
20 , fromStreamS
@@ -101,11 +100,6 @@ module Streamly.Internal.Data.Stream.IsStream.Type
101 -- * Zip style operations
100 -- * Zip style operations
102 , eqBy
101 , eqBy
103 , cmpBy
102 , cmpBy
104−
105− -- * Deprecated
106− , interleaving
107− , zipping
108− , zippingAsync
109 )
103 )
110where
104where
111
105
@@ -205,12 +199,6 @@ class
205 -- We can define (|:) just as 'consM' but it is defined explicitly for each
199 -- We can define (|:) just as 'consM' but it is defined explicitly for each
206 -- type because we want to use SPECIALIZE pragma on the definition.
200 -- type because we want to use SPECIALIZE pragma on the definition.
207
201
208−-- | Same as 'IsStream'.
209−--
210−-- @since 0.1.0
211−{-# DEPRECATED Streaming "Please use IsStream instead." #-}
212−type Streaming = IsStream
213−
214-------------------------------------------------------------------------------
202-------------------------------------------------------------------------------
215-- Type adapting combinators
203-- Type adapting combinators
216-------------------------------------------------------------------------------
204-------------------------------------------------------------------------------
@@ -494,13 +482,6 @@ instance IsStream SerialT where
494fromWSerial :: IsStream t => WSerialT m a -> t m a
482fromWSerial :: IsStream t => WSerialT m a -> t m a
495fromWSerial = adapt
483fromWSerial = adapt
496
484
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−
504instance IsStream WSerialT where
485instance IsStream WSerialT where
505 toStream = getWSerialT
486 toStream = getWSerialT
506 fromStream = WSerialT
487 fromStream = WSerialT
@@ -618,14 +599,6 @@ instance IsStream ParallelT where
618-- @since 0.8.0
599-- @since 0.8.0
619fromZipSerial :: IsStream t => ZipSerialM m a -> t m a
600fromZipSerial :: IsStream t => ZipSerialM m a -> t m a
620fromZipSerial = adapt
601fromZipSerial = 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−
629instance IsStream ZipSerialM where
602instance IsStream ZipSerialM where
630 toStream = getZipSerialM
603 toStream = getZipSerialM
631 fromStream = ZipSerialM
604 fromStream = ZipSerialM
@@ -648,13 +621,6 @@ instance IsStream ZipSerialM where
648fromZipAsync :: IsStream t => ZipAsyncM m a -> t m a
621fromZipAsync :: IsStream t => ZipAsyncM m a -> t m a
649fromZipAsync = adapt
622fromZipAsync = adapt
650
623
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−
658instance IsStream ZipAsyncM where
624instance IsStream ZipAsyncM where
659 toStream = getZipAsyncM
625 toStream = getZipAsyncM
660 fromStream = ZipAsyncM
626 fromStream = ZipAsyncM
src/Streamly/Prelude.hs−2
@@ -919,10 +919,8 @@ module Streamly.Prelude
919 , adapt
919 , adapt
920
920
921 -- * Deprecated
921 -- * Deprecated
922− , once
923 , yield
922 , yield
924 , yieldM
923 , yieldM
925− , each
926 , scanx
924 , scanx
927 , foldx
925 , foldx
928 , foldxM
926 , foldxM
streamly.cabal−2
@@ -150,7 +150,6 @@ extra-source-files:
150 core/src/Streamly/Internal/Control/Concurrent.hs
150 core/src/Streamly/Internal/Control/Concurrent.hs
151 core/src/Streamly/Internal/Control/ForkLifted.hs
151 core/src/Streamly/Internal/Control/ForkLifted.hs
152 core/src/Streamly/Internal/Data/IOFinalizer.hs
152 core/src/Streamly/Internal/Data/IOFinalizer.hs
153− core/src/Streamly/Internal/Data/Time.hs
154 core/src/Streamly/Internal/Data/Time/TimeSpec.hsc
153 core/src/Streamly/Internal/Data/Time/TimeSpec.hsc
155 core/src/Streamly/Internal/Data/Time/Units.hs
154 core/src/Streamly/Internal/Data/Time/Units.hs
156 core/src/Streamly/Internal/Data/Time/Clock/Type.hsc
155 core/src/Streamly/Internal/Data/Time/Clock/Type.hsc
@@ -529,7 +528,6 @@ library
529 , Streamly.Internal.Data.IOFinalizer
528 , Streamly.Internal.Data.IOFinalizer
530
529
531 -- streamly-time
530 -- streamly-time
532− , Streamly.Internal.Data.Time
533 , Streamly.Internal.Data.Time.TimeSpec
531 , Streamly.Internal.Data.Time.TimeSpec
534 , Streamly.Internal.Data.Time.Units
532 , Streamly.Internal.Data.Time.Units
535 , Streamly.Internal.Data.Time.Clock.Type
533 , Streamly.Internal.Data.Time.Clock.Type