on master help sign in
Replace /Internal/ annotation to /Pre-release/
305f89bRanjeet Kumar Ranjan
src/Streamly/Internal/Control/Exception.hs+3−3
@@ -21,7 +21,7 @@ import Control.Exception (assert)
21-- Like 'assert' but returns @()@ in an 'Applicative' context so that it can be
21-- Like 'assert' but returns @()@ in an 'Applicative' context so that it can be
22-- used as an independent statement in a @do@ block.
22-- used as an independent statement in a @do@ block.
23--
23--
24−-- /Internal/
24+-- /Pre-release/
25--
25--
26{-# INLINE assertM #-}
26{-# INLINE assertM #-}
27assertM :: Applicative f => Bool -> f ()
27assertM :: Applicative f => Bool -> f ()
@@ -30,7 +30,7 @@ assertM predicate = assert predicate (pure ())
30-- | Like 'assert' but is not removed by the compiler, it is always present in
30-- | Like 'assert' but is not removed by the compiler, it is always present in
31-- production code.
31-- production code.
32--
32--
33−-- /Internal/
33+-- /Pre-release/
34--
34--
35{-# INLINE verify #-}
35{-# INLINE verify #-}
36verify :: Bool -> a -> a
36verify :: Bool -> a -> a
@@ -43,7 +43,7 @@ verify predicate val =
43-- Like 'verify' but returns @()@ in an 'Applicative' context so that it can be
43-- Like 'verify' but returns @()@ in an 'Applicative' context so that it can be
44-- used as an independent statement in a @do@ block.
44-- used as an independent statement in a @do@ block.
45--
45--
46−-- /Internal/
46+-- /Pre-release/
47--
47--
48{-# INLINE verifyM #-}
48{-# INLINE verifyM #-}
49verifyM :: Applicative f => Bool -> f ()
49verifyM :: Applicative f => Bool -> f ()
src/Streamly/Internal/Control/Monad.hs+1−1
@@ -19,7 +19,7 @@ import Control.Monad.Catch (MonadCatch, catch, SomeException)
19
19
20-- | Discard any exceptions or value returned by an effectful action.
20-- | Discard any exceptions or value returned by an effectful action.
21--
21--
22−-- /Internal/
22+-- /Pre-release/
23--
23--
24{-# INLINE discard #-}
24{-# INLINE discard #-}
25discard :: MonadCatch m => m b -> m ()
25discard :: MonadCatch m => m b -> m ()
src/Streamly/Internal/Data/Array/Foreign.hs+15−15
@@ -183,7 +183,7 @@ import qualified Streamly.Internal.Ring.Foreign as RB
183-- allocated to size N, if the stream terminates before N elements then the
183-- allocated to size N, if the stream terminates before N elements then the
184-- array may hold less than N elements.
184-- array may hold less than N elements.
185--
185--
186−-- /Internal/
186+-- /Pre-release/
187{-# INLINE fromStreamN #-}
187{-# INLINE fromStreamN #-}
188fromStreamN :: (MonadIO m, Storable a) => Int -> SerialT m a -> m (Array a)
188fromStreamN :: (MonadIO m, Storable a) => Int -> SerialT m a -> m (Array a)
189fromStreamN n m = do
189fromStreamN n m = do
@@ -198,7 +198,7 @@ fromStreamN n m = do
198-- may fail. When the stream size is not known, `arraysOf` followed by
198-- may fail. When the stream size is not known, `arraysOf` followed by
199-- processing of indvidual arrays in the resulting stream should be preferred.
199-- processing of indvidual arrays in the resulting stream should be preferred.
200--
200--
201−-- /Internal/
201+-- /Pre-release/
202{-# INLINE fromStream #-}
202{-# INLINE fromStream #-}
203fromStream :: (MonadIO m, Storable a) => SerialT m a -> m (Array a)
203fromStream :: (MonadIO m, Storable a) => SerialT m a -> m (Array a)
204fromStream = P.foldOnce A.write
204fromStream = P.foldOnce A.write
@@ -228,7 +228,7 @@ producer = Producer.translate A.unsafeThaw A.unsafeFreeze MA.producer
228-- for which this was written, "read" proves to be faster even though the core
228-- for which this was written, "read" proves to be faster even though the core
229-- generated with unsafeRead looks simpler.
229-- generated with unsafeRead looks simpler.
230--
230--
231−-- /Internal/
231+-- /Pre-release/
232--
232--
233{-# INLINE_NORMAL unsafeRead #-}
233{-# INLINE_NORMAL unsafeRead #-}
234unsafeRead :: forall m a. (Monad m, Storable a) => Unfold m (Array a) a
234unsafeRead :: forall m a. (Monad m, Storable a) => Unfold m (Array a) a
@@ -256,14 +256,14 @@ unsafeRead = Unfold step inject
256
256
257-- | > null arr = length arr == 0
257-- | > null arr = length arr == 0
258--
258--
259−-- /Internal/
259+-- /Pre-release/
260{-# INLINE null #-}
260{-# INLINE null #-}
261null :: Storable a => Array a -> Bool
261null :: Storable a => Array a -> Bool
262null arr = length arr == 0
262null arr = length arr == 0
263
263
264-- | > last arr = readIndex arr (length arr - 1)
264-- | > last arr = readIndex arr (length arr - 1)
265--
265--
266−-- /Internal/
266+-- /Pre-release/
267{-# INLINE last #-}
267{-# INLINE last #-}
268last :: Storable a => Array a -> Maybe a
268last :: Storable a => Array a -> Maybe a
269last arr = readIndex arr (length arr - 1)
269last arr = readIndex arr (length arr - 1)
@@ -395,7 +395,7 @@ foldbWith level f = undefined
395
395
396-- | /O(1)/ Lookup the element at the given index, starting from 0.
396-- | /O(1)/ Lookup the element at the given index, starting from 0.
397--
397--
398−-- /Internal/
398+-- /Pre-release/
399{-# INLINE readIndex #-}
399{-# INLINE readIndex #-}
400readIndex :: Storable a => Array a -> Int -> Maybe a
400readIndex :: Storable a => Array a -> Int -> Maybe a
401readIndex arr i =
401readIndex arr i =
@@ -429,7 +429,7 @@ readSliceRev arr i len = undefined
429-- | /O(1)/ Write the given element at the given index in the array.
429-- | /O(1)/ Write the given element at the given index in the array.
430-- Performs in-place mutation of the array.
430-- Performs in-place mutation of the array.
431--
431--
432−-- /Internal/
432+-- /Pre-release/
433{-# INLINE writeIndex #-}
433{-# INLINE writeIndex #-}
434writeIndex :: (MonadIO m, Storable a) => Array a -> Int -> a -> m ()
434writeIndex :: (MonadIO m, Storable a) => Array a -> Int -> a -> m ()
435writeIndex arr i a = do
435writeIndex arr i a = do
@@ -487,7 +487,7 @@ runPipe f arr = P.runPipe (toArrayMinChunk (length arr)) $ f (A.read arr)
487-- | Transform an array into another array using a stream transformation
487-- | Transform an array into another array using a stream transformation
488-- operation.
488-- operation.
489--
489--
490−-- /Internal/
490+-- /Pre-release/
491{-# INLINE streamTransform #-}
491{-# INLINE streamTransform #-}
492streamTransform :: forall m a b. (MonadIO m, Storable a, Storable b)
492streamTransform :: forall m a b. (MonadIO m, Storable a, Storable b)
493 => (SerialT m a -> SerialT m b) -> Array a -> m (Array b)
493 => (SerialT m a -> SerialT m b) -> Array a -> m (Array b)
@@ -504,7 +504,7 @@ streamTransform f arr =
504-- otherwise accessing the last element of the array may result into a crash or
504-- otherwise accessing the last element of the array may result into a crash or
505-- a random value.
505-- a random value.
506--
506--
507−-- /Internal/
507+-- /Pre-release/
508--
508--
509unsafeCast ::
509unsafeCast ::
510#ifdef DEVBUILD
510#ifdef DEVBUILD
@@ -515,7 +515,7 @@ unsafeCast (Array start end) = Array (castForeignPtr start) (castPtr end)
515
515
516-- | Cast an array into a Word8 array
516-- | Cast an array into a Word8 array
517--
517--
518−-- /Internal/
518+-- /Pre-release/
519--
519--
520asByteArray :: Array a -> Array Word8
520asByteArray :: Array a -> Array Word8
521asByteArray = unsafeCast
521asByteArray = unsafeCast
@@ -524,7 +524,7 @@ asByteArray = unsafeCast
524-- type @b@. The length of the array should be a multiple of the size of the
524-- type @b@. The length of the array should be a multiple of the size of the
525-- target element otherwise 'Nothing' is returned.
525-- target element otherwise 'Nothing' is returned.
526--
526--
527−-- /Internal/
527+-- /Pre-release/
528--
528--
529cast :: forall a b. (Storable b) => Array a -> Maybe (Array b)
529cast :: forall a b. (Storable b) => Array a -> Maybe (Array b)
530cast arr =
530cast arr =
@@ -538,7 +538,7 @@ cast arr =
538--
538--
539-- /Unsafe/
539-- /Unsafe/
540--
540--
541−-- /Internal/
541+-- /Pre-release/
542--
542--
543asPtr :: Array a -> (Ptr b -> IO c) -> IO c
543asPtr :: Array a -> (Ptr b -> IO c) -> IO c
544asPtr Array{..} act = do
544asPtr Array{..} act = do
@@ -550,7 +550,7 @@ asPtr Array{..} act = do
550--
550--
551-- /O(n) Time: (creates a copy of the array)/
551-- /O(n) Time: (creates a copy of the array)/
552--
552--
553−-- /Internal/
553+-- /Pre-release/
554--
554--
555asCString :: Array a -> (CString -> IO b) -> IO b
555asCString :: Array a -> (CString -> IO b) -> IO b
556asCString arr act = do
556asCString arr act = do
@@ -563,14 +563,14 @@ asCString arr act = do
563
563
564-- | Fold an array using a 'Fold'.
564-- | Fold an array using a 'Fold'.
565--
565--
566−-- /Internal/
566+-- /Pre-release/
567{-# INLINE fold #-}
567{-# INLINE fold #-}
568fold :: forall m a b. (MonadIO m, Storable a) => Fold m a b -> Array a -> m b
568fold :: forall m a b. (MonadIO m, Storable a) => Fold m a b -> Array a -> m b
569fold f arr = P.foldOnce f (A.toStream arr :: Serial.SerialT m a)
569fold f arr = P.foldOnce f (A.toStream arr :: Serial.SerialT m a)
570
570
571-- | Fold an array using a stream fold operation.
571-- | Fold an array using a stream fold operation.
572--
572--
573−-- /Internal/
573+-- /Pre-release/
574{-# INLINE streamFold #-}
574{-# INLINE streamFold #-}
575streamFold :: (MonadIO m, Storable a) => (SerialT m a -> m b) -> Array a -> m b
575streamFold :: (MonadIO m, Storable a) => (SerialT m a -> m b) -> Array a -> m b
576streamFold f arr = f (A.toStream arr)
576streamFold f arr = f (A.toStream arr)
src/Streamly/Internal/Data/Array/Foreign/Mut/Types.hs+5−5
@@ -423,7 +423,7 @@ length arr = byteLength arr `div` sizeOf (undefined :: a)
423-- | Get the total capacity of an array. An array may have space reserved
423-- | Get the total capacity of an array. An array may have space reserved
424-- beyond the current used length of the array.
424-- beyond the current used length of the array.
425--
425--
426−-- /Internal/
426+-- /Pre-release/
427{-# INLINE byteCapacity #-}
427{-# INLINE byteCapacity #-}
428byteCapacity :: Array a -> Int
428byteCapacity :: Array a -> Int
429byteCapacity Array{..} =
429byteCapacity Array{..} =
@@ -446,7 +446,7 @@ data GroupState s start end bound
446--
446--
447-- @arraysOf n = StreamD.foldMany (Array.writeN n)@
447-- @arraysOf n = StreamD.foldMany (Array.writeN n)@
448--
448--
449−-- /Internal/
449+-- /Pre-release/
450{-# INLINE_NORMAL arraysOf #-}
450{-# INLINE_NORMAL arraysOf #-}
451arraysOf :: forall m a. (MonadIO m, Storable a)
451arraysOf :: forall m a. (MonadIO m, Storable a)
452 => Int -> D.Stream m a -> D.Stream m (Array a)
452 => Int -> D.Stream m a -> D.Stream m (Array a)
@@ -538,7 +538,7 @@ read = Producer.simplify producer
538
538
539-- | Unfold an array into a stream in reverse order.
539-- | Unfold an array into a stream in reverse order.
540--
540--
541−-- /Internal/
541+-- /Pre-release/
542{-# INLINE_NORMAL readRev #-}
542{-# INLINE_NORMAL readRev #-}
543readRev :: forall m a. (Monad m, Storable a) => Unfold m (Array a) a
543readRev :: forall m a. (Monad m, Storable a) => Unfold m (Array a) a
544readRev = Unfold step inject
544readRev = Unfold step inject
@@ -799,7 +799,7 @@ writeN = writeNAllocWith newArray
799-- | @writeNAligned alignment n@ folds a maximum of @n@ elements from the input
799-- | @writeNAligned alignment n@ folds a maximum of @n@ elements from the input
800-- stream to an 'Array' aligned to the given size.
800-- stream to an 'Array' aligned to the given size.
801--
801--
802−-- /Internal/
802+-- /Pre-release/
803--
803--
804{-# INLINE_NORMAL writeNAligned #-}
804{-# INLINE_NORMAL writeNAligned #-}
805writeNAligned :: forall m a. (MonadIO m, Storable a)
805writeNAligned :: forall m a. (MonadIO m, Storable a)
@@ -811,7 +811,7 @@ writeNAligned alignSize = writeNAllocWith (newArrayAligned alignSize)
811-- This could be useful to allocate memory that we need to allocate only once
811-- This could be useful to allocate memory that we need to allocate only once
812-- in the lifetime of the program.
812-- in the lifetime of the program.
813--
813--
814−-- /Internal/
814+-- /Pre-release/
815--
815--
816{-# INLINE_NORMAL writeNAlignedUnmanaged #-}
816{-# INLINE_NORMAL writeNAlignedUnmanaged #-}
817writeNAlignedUnmanaged :: forall m a. (MonadIO m, Storable a)
817writeNAlignedUnmanaged :: forall m a. (MonadIO m, Storable a)
src/Streamly/Internal/Data/Array/Foreign/Types.hs+8−8
@@ -202,7 +202,7 @@ spliceTwo arr1 arr2 =
202--
202--
203-- /Unsafe/
203-- /Unsafe/
204--
204--
205−-- /Internal/
205+-- /Pre-release/
206--
206--
207{-# INLINE fromPtr #-}
207{-# INLINE fromPtr #-}
208fromPtr ::
208fromPtr ::
@@ -249,7 +249,7 @@ fromPtr n ptr = MA.unsafeInlineIO $ do
249--
249--
250-- /Time complexity: O(1)/
250-- /Time complexity: O(1)/
251--
251--
252−-- /Internal/
252+-- /Pre-release/
253--
253--
254{-# INLINE fromAddr# #-}
254{-# INLINE fromAddr# #-}
255fromAddr# ::
255fromAddr# ::
@@ -281,7 +281,7 @@ fromAddr# n addr# = fromPtr n (castPtr $ Ptr addr#)
281--
281--
282-- /Time complexity: O(n) (computes the length of the string)/
282-- /Time complexity: O(n) (computes the length of the string)/
283--
283--
284−-- /Internal/
284+-- /Pre-release/
285--
285--
286{-# INLINE fromCString# #-}
286{-# INLINE fromCString# #-}
287fromCString# :: Addr# -> Array Word8
287fromCString# :: Addr# -> Array Word8
@@ -395,7 +395,7 @@ length arr = MA.length (unsafeThaw arr)
395
395
396-- | Unfold an array into a stream in reverse order.
396-- | Unfold an array into a stream in reverse order.
397--
397--
398−-- /Internal/
398+-- /Pre-release/
399{-# INLINE_NORMAL readRev #-}
399{-# INLINE_NORMAL readRev #-}
400readRev :: forall m a. (Monad m, Storable a) => Unfold m (Array a) a
400readRev :: forall m a. (Monad m, Storable a) => Unfold m (Array a) a
401readRev = Unfold.lmap unsafeThaw MA.readRev
401readRev = Unfold.lmap unsafeThaw MA.readRev
@@ -418,7 +418,7 @@ toStreamKRev arr = MA.toStreamKRev (unsafeThaw arr)
418
418
419-- | Convert an 'Array' into a stream.
419-- | Convert an 'Array' into a stream.
420--
420--
421−-- /Internal/
421+-- /Pre-release/
422{-# INLINE_EARLY toStream #-}
422{-# INLINE_EARLY toStream #-}
423toStream :: (Monad m, K.IsStream t, Storable a) => Array a -> t m a
423toStream :: (Monad m, K.IsStream t, Storable a) => Array a -> t m a
424toStream = D.fromStreamD . toStreamD
424toStream = D.fromStreamD . toStreamD
@@ -428,7 +428,7 @@ toStream = D.fromStreamD . toStreamD
428
428
429-- | Convert an 'Array' into a stream in reverse order.
429-- | Convert an 'Array' into a stream in reverse order.
430--
430--
431−-- /Internal/
431+-- /Pre-release/
432{-# INLINE_EARLY toStreamRev #-}
432{-# INLINE_EARLY toStreamRev #-}
433toStreamRev :: (Monad m, K.IsStream t, Storable a) => Array a -> t m a
433toStreamRev :: (Monad m, K.IsStream t, Storable a) => Array a -> t m a
434toStreamRev = D.fromStreamD . toStreamDRev
434toStreamRev = D.fromStreamD . toStreamDRev
@@ -476,7 +476,7 @@ writeN = fmap unsafeFreeze . MA.writeN
476-- | @writeNAligned alignment n@ folds a maximum of @n@ elements from the input
476-- | @writeNAligned alignment n@ folds a maximum of @n@ elements from the input
477-- stream to an 'Array' aligned to the given size.
477-- stream to an 'Array' aligned to the given size.
478--
478--
479−-- /Internal/
479+-- /Pre-release/
480--
480--
481{-# INLINE_NORMAL writeNAligned #-}
481{-# INLINE_NORMAL writeNAligned #-}
482writeNAligned :: forall m a. (MonadIO m, Storable a)
482writeNAligned :: forall m a. (MonadIO m, Storable a)
@@ -488,7 +488,7 @@ writeNAligned alignSize = fmap unsafeFreeze . MA.writeNAligned alignSize
488-- This could be useful to allocate memory that we need to allocate only once
488-- This could be useful to allocate memory that we need to allocate only once
489-- in the lifetime of the program.
489-- in the lifetime of the program.
490--
490--
491−-- /Internal/
491+-- /Pre-release/
492--
492--
493{-# INLINE_NORMAL writeNAlignedUnmanaged #-}
493{-# INLINE_NORMAL writeNAlignedUnmanaged #-}
494writeNAlignedUnmanaged :: forall m a. (MonadIO m, Storable a)
494writeNAlignedUnmanaged :: forall m a. (MonadIO m, Storable a)
src/Streamly/Internal/Data/Array/Prim/MutTypesInclude.hs+4−4
@@ -134,7 +134,7 @@ shrinkArray (Array arr#) (I# n#) =
134--
134--
135-- /Caution! Do not use this on infinite streams./
135-- /Caution! Do not use this on infinite streams./
136--
136--
137−-- /Internal/
137+-- /Pre-release/
138{-# INLINE_NORMAL write #-}
138{-# INLINE_NORMAL write #-}
139write :: (MonadIO m, Prim a) => Fold m a (Array a)
139write :: (MonadIO m, Prim a) => Fold m a (Array a)
140write = FL.mkAccumM step initial extract
140write = FL.mkAccumM step initial extract
@@ -160,7 +160,7 @@ write = FL.mkAccumM step initial extract
160-- | @writeN n@ folds a maximum of @n@ elements from the input stream to an
160-- | @writeN n@ folds a maximum of @n@ elements from the input stream to an
161-- 'Array'.
161-- 'Array'.
162--
162--
163−-- /Internal/
163+-- /Pre-release/
164{-# INLINE_NORMAL writeN #-}
164{-# INLINE_NORMAL writeN #-}
165writeN :: (MonadIO m, Prim a) => Int -> Fold m a (Array a)
165writeN :: (MonadIO m, Prim a) => Int -> Fold m a (Array a)
166writeN limit = Fold step initial extract
166writeN limit = Fold step initial extract
@@ -190,7 +190,7 @@ data ArrayUnsafe a = ArrayUnsafe
190-- conditional in the step function blocks fusion causing 10x performance
190-- conditional in the step function blocks fusion causing 10x performance
191-- slowdown.
191-- slowdown.
192--
192--
193−-- /Internal/
193+-- /Pre-release/
194{-# INLINE_NORMAL writeNUnsafe #-}
194{-# INLINE_NORMAL writeNUnsafe #-}
195writeNUnsafe :: (MonadIO m, Prim a) => Int -> Fold m a (Array a)
195writeNUnsafe :: (MonadIO m, Prim a) => Int -> Fold m a (Array a)
196writeNUnsafe n = FL.mkAccumM step initial extract
196writeNUnsafe n = FL.mkAccumM step initial extract
@@ -303,7 +303,7 @@ data SpliceState s arr
303-- arrays if the size would exceed the specified size we do not coalesce
303-- arrays if the size would exceed the specified size we do not coalesce
304-- therefore the actual array size may be less than the specified chunk size.
304-- therefore the actual array size may be less than the specified chunk size.
305--
305--
306−-- /Internal/
306+-- /Pre-release/
307{-# INLINE_NORMAL packArraysChunksOf #-}
307{-# INLINE_NORMAL packArraysChunksOf #-}
308packArraysChunksOf ::
308packArraysChunksOf ::
309 (MonadIO m, Prim a)
309 (MonadIO m, Prim a)
src/Streamly/Internal/Data/Array/Prim/TypesInclude.hs+6−6
@@ -159,7 +159,7 @@ nil =
159--
159--
160-- /Caution! Do not use this on infinite streams./
160-- /Caution! Do not use this on infinite streams./
161--
161--
162−-- /Internal/
162+-- /Pre-release/
163{-# INLINE_NORMAL write #-}
163{-# INLINE_NORMAL write #-}
164write :: (MonadIO m, Prim a) => Fold m a (Array a)
164write :: (MonadIO m, Prim a) => Fold m a (Array a)
165write = FL.rmapM unsafeFreeze MA.write
165write = FL.rmapM unsafeFreeze MA.write
@@ -167,7 +167,7 @@ write = FL.rmapM unsafeFreeze MA.write
167-- | @writeN n@ folds a maximum of @n@ elements from the input stream to an
167-- | @writeN n@ folds a maximum of @n@ elements from the input stream to an
168-- 'Array'.
168-- 'Array'.
169--
169--
170−-- /Internal/
170+-- /Pre-release/
171{-# INLINE_NORMAL writeN #-}
171{-# INLINE_NORMAL writeN #-}
172writeN :: (MonadIO m, Prim a) => Int -> Fold m a (Array a)
172writeN :: (MonadIO m, Prim a) => Int -> Fold m a (Array a)
173writeN limit = FL.rmapM unsafeFreeze (MA.writeN limit)
173writeN limit = FL.rmapM unsafeFreeze (MA.writeN limit)
@@ -178,7 +178,7 @@ writeN limit = FL.rmapM unsafeFreeze (MA.writeN limit)
178-- conditional in the step function blocks fusion causing 10x performance
178-- conditional in the step function blocks fusion causing 10x performance
179-- slowdown.
179-- slowdown.
180--
180--
181−-- /Internal/
181+-- /Pre-release/
182{-# INLINE_NORMAL writeNUnsafe #-}
182{-# INLINE_NORMAL writeNUnsafe #-}
183writeNUnsafe :: (MonadIO m, Prim a) => Int -> Fold m a (Array a)
183writeNUnsafe :: (MonadIO m, Prim a) => Int -> Fold m a (Array a)
184writeNUnsafe limit = FL.rmapM unsafeFreeze (MA.writeNUnsafe limit)
184writeNUnsafe limit = FL.rmapM unsafeFreeze (MA.writeNUnsafe limit)
@@ -239,7 +239,7 @@ toListFB c n arr = go 0
239
239
240-- | Convert an 'Array' into a list.
240-- | Convert an 'Array' into a list.
241--
241--
242−-- /Internal/
242+-- /Pre-release/
243{-# INLINE toList #-}
243{-# INLINE toList #-}
244toList :: Prim a => Array a -> [a]
244toList :: Prim a => Array a -> [a]
245toList s = build (\c n -> toListFB c n s)
245toList s = build (\c n -> toListFB c n s)
@@ -534,7 +534,7 @@ data SpliceState s arr1 arr2
534-- arrays if the size would exceed the specified size we do not coalesce
534-- arrays if the size would exceed the specified size we do not coalesce
535-- therefore the actual array size may be less than the specified chunk size.
535-- therefore the actual array size may be less than the specified chunk size.
536--
536--
537−-- /Internal/
537+-- /Pre-release/
538{-# INLINE_NORMAL packArraysChunksOf #-}
538{-# INLINE_NORMAL packArraysChunksOf #-}
539packArraysChunksOf ::
539packArraysChunksOf ::
540 forall m a. (MonadIO m, Prim a)
540 forall m a. (MonadIO m, Prim a)
@@ -655,7 +655,7 @@ data SplitState s arr
655-- | Split a stream of arrays on a given separator byte, dropping the separator
655-- | Split a stream of arrays on a given separator byte, dropping the separator
656-- and coalescing all the arrays between two separators into a single array.
656-- and coalescing all the arrays between two separators into a single array.
657--
657--
658−-- /Internal/
658+-- /Pre-release/
659{-# INLINE_NORMAL splitOn #-}
659{-# INLINE_NORMAL splitOn #-}
660splitOn ::
660splitOn ::
661 MonadIO m
661 MonadIO m
src/Streamly/Internal/Data/Array/PrimInclude.hs+12−12
@@ -27,7 +27,7 @@ import Prelude hiding (length, null, last, map, (!!), read, concat)
27-- allocated to size N, if the stream terminates before N elements then the
27-- allocated to size N, if the stream terminates before N elements then the
28-- array may hold less than N elements.
28-- array may hold less than N elements.
29--
29--
30−-- /Internal/
30+-- /Pre-release/
31{-# INLINE fromStreamN #-}
31{-# INLINE fromStreamN #-}
32fromStreamN :: (MonadIO m, Prim a) => Int -> SerialT m a -> m (Array a)
32fromStreamN :: (MonadIO m, Prim a) => Int -> SerialT m a -> m (Array a)
33fromStreamN n m = do
33fromStreamN n m = do
@@ -42,7 +42,7 @@ fromStreamN n m = do
42-- may fail. When the stream size is not known, `arraysOf` followed by
42-- may fail. When the stream size is not known, `arraysOf` followed by
43-- processing of indvidual arrays in the resulting stream should be preferred.
43-- processing of indvidual arrays in the resulting stream should be preferred.
44--
44--
45−-- /Internal/
45+-- /Pre-release/
46{-# INLINE fromStream #-}
46{-# INLINE fromStream #-}
47fromStream :: (MonadIO m, Prim a) => SerialT m a -> m (Array a)
47fromStream :: (MonadIO m, Prim a) => SerialT m a -> m (Array a)
48fromStream = P.foldOnce A.write
48fromStream = P.foldOnce A.write
@@ -54,7 +54,7 @@ fromStream = P.foldOnce A.write
54
54
55-- | Convert an 'Array' into a stream.
55-- | Convert an 'Array' into a stream.
56--
56--
57−-- /Internal/
57+-- /Pre-release/
58{-# INLINE_EARLY toStream #-}
58{-# INLINE_EARLY toStream #-}
59toStream :: (MonadIO m, K.IsStream t, Prim a) => Array a -> t m a
59toStream :: (MonadIO m, K.IsStream t, Prim a) => Array a -> t m a
60toStream = D.fromStreamD . A.toStreamD
60toStream = D.fromStreamD . A.toStreamD
@@ -64,7 +64,7 @@ toStream = D.fromStreamD . A.toStreamD
64
64
65-- | Convert an 'Array' into a stream in reverse order.
65-- | Convert an 'Array' into a stream in reverse order.
66--
66--
67−-- /Internal/
67+-- /Pre-release/
68{-# INLINE_EARLY toStreamRev #-}
68{-# INLINE_EARLY toStreamRev #-}
69toStreamRev :: (MonadIO m, IsStream t, Prim a) => Array a -> t m a
69toStreamRev :: (MonadIO m, IsStream t, Prim a) => Array a -> t m a
70toStreamRev = D.fromStreamD . A.toStreamDRev
70toStreamRev = D.fromStreamD . A.toStreamDRev
@@ -98,7 +98,7 @@ read = Unfold step inject
98-- for which this was written, "read" proves to be faster even though the core
98-- for which this was written, "read" proves to be faster even though the core
99-- generated with unsafeRead looks simpler.
99-- generated with unsafeRead looks simpler.
100--
100--
101−-- /Internal/
101+-- /Pre-release/
102--
102--
103{-# INLINE_NORMAL unsafeRead #-}
103{-# INLINE_NORMAL unsafeRead #-}
104unsafeRead :: (MonadIO m, Prim a) => Unfold m (Array a) a
104unsafeRead :: (MonadIO m, Prim a) => Unfold m (Array a) a
@@ -114,7 +114,7 @@ unsafeRead = Unfold step inject
114
114
115-- | > null arr = length arr == 0
115-- | > null arr = length arr == 0
116--
116--
117−-- /Internal/
117+-- /Pre-release/
118{-# INLINE null #-}
118{-# INLINE null #-}
119null :: Array a -> Bool
119null :: Array a -> Bool
120null arr = length arr == 0
120null arr = length arr == 0
@@ -125,14 +125,14 @@ null arr = length arr == 0
125
125
126-- | Fold an array using a 'Fold'.
126-- | Fold an array using a 'Fold'.
127--
127--
128−-- /Internal/
128+-- /Pre-release/
129{-# INLINE fold #-}
129{-# INLINE fold #-}
130fold :: forall m a b. (MonadIO m, Prim a) => Fold m a b -> Array a -> m b
130fold :: forall m a b. (MonadIO m, Prim a) => Fold m a b -> Array a -> m b
131fold f arr = P.foldOnce f (toStream arr :: Serial.SerialT m a)
131fold f arr = P.foldOnce f (toStream arr :: Serial.SerialT m a)
132
132
133-- | Fold an array using a stream fold operation.
133-- | Fold an array using a stream fold operation.
134--
134--
135−-- /Internal/
135+-- /Pre-release/
136{-# INLINE streamFold #-}
136{-# INLINE streamFold #-}
137streamFold :: (MonadIO m, Prim a) => (SerialT m a -> m b) -> Array a -> m b
137streamFold :: (MonadIO m, Prim a) => (SerialT m a -> m b) -> Array a -> m b
138streamFold f arr = f (toStream arr)
138streamFold f arr = f (toStream arr)
@@ -143,7 +143,7 @@ streamFold f arr = f (toStream arr)
143
143
144-- | /O(1)/ Lookup the element at the given index, starting from 0.
144-- | /O(1)/ Lookup the element at the given index, starting from 0.
145--
145--
146−-- /Internal/
146+-- /Pre-release/
147{-# INLINE readIndex #-}
147{-# INLINE readIndex #-}
148readIndex :: Prim a => Array a -> Int -> Maybe a
148readIndex :: Prim a => Array a -> Int -> Maybe a
149readIndex arr i =
149readIndex arr i =
@@ -153,7 +153,7 @@ readIndex arr i =
153
153
154-- | > last arr = readIndex arr (length arr - 1)
154-- | > last arr = readIndex arr (length arr - 1)
155--
155--
156−-- /Internal/
156+-- /Pre-release/
157{-# INLINE last #-}
157{-# INLINE last #-}
158last :: Prim a => Array a -> Maybe a
158last :: Prim a => Array a -> Maybe a
159last arr = readIndex arr (length arr - 1)
159last arr = readIndex arr (length arr - 1)
@@ -168,7 +168,7 @@ last arr = readIndex arr (length arr - 1)
168--
168--
169-- > concat = S.concatMap A.read
169-- > concat = S.concatMap A.read
170--
170--
171−-- /Internal/
171+-- /Pre-release/
172{-# INLINE concat #-}
172{-# INLINE concat #-}
173concat :: (IsStream t, MonadIO m, Prim a) => t m (Array a) -> t m a
173concat :: (IsStream t, MonadIO m, Prim a) => t m (Array a) -> t m a
174-- concat m = D.fromStreamD $ A.flattenArrays (D.toStreamD m)
174-- concat m = D.fromStreamD $ A.flattenArrays (D.toStreamD m)
@@ -178,7 +178,7 @@ concat m = D.fromStreamD $ D.concatUnfold read (D.toStreamD m)
178-- | Coalesce adjacent arrays in incoming stream to form bigger arrays of a
178-- | Coalesce adjacent arrays in incoming stream to form bigger arrays of a
179-- maximum specified size in bytes.
179-- maximum specified size in bytes.
180--
180--
181−-- /Internal/
181+-- /Pre-release/
182{-# INLINE compact #-}
182{-# INLINE compact #-}
183compact ::
183compact ::
184 (MonadIO m, Prim a) => Int -> SerialT m (Array a) -> SerialT m (Array a)
184 (MonadIO m, Prim a) => Int -> SerialT m (Array a) -> SerialT m (Array a)
src/Streamly/Internal/Data/Array/Stream/Foreign.hs+2−2
@@ -75,7 +75,7 @@ import qualified Streamly.Internal.Data.Stream.StreamD as D
75--
75--
76-- > arraysOf n = Stream.chunksOf n (Array.writeN n)
76-- > arraysOf n = Stream.chunksOf n (Array.writeN n)
77--
77--
78−-- /Internal/
78+-- /Pre-release/
79{-# INLINE arraysOf #-}
79{-# INLINE arraysOf #-}
80arraysOf :: (IsStream t, MonadIO m, Storable a)
80arraysOf :: (IsStream t, MonadIO m, Storable a)
81 => Int -> t m a -> t m (Array a)
81 => Int -> t m a -> t m (Array a)
@@ -119,7 +119,7 @@ concatRev m = D.fromStreamD $ A.flattenArraysRev (D.toStreamD m)
119-- | Flatten a stream of arrays after inserting the given element between
119-- | Flatten a stream of arrays after inserting the given element between
120-- arrays.
120-- arrays.
121--
121--
122−-- /Internal/
122+-- /Pre-release/
123{-# INLINE interpose #-}
123{-# INLINE interpose #-}
124interpose :: (MonadIO m, IsStream t, Storable a) => a -> t m (Array a) -> t m a
124interpose :: (MonadIO m, IsStream t, Storable a) => a -> t m (Array a) -> t m a
125interpose x = S.interpose x A.read
125interpose x = S.interpose x A.read
src/Streamly/Internal/Data/Array/Stream/Mut/Foreign.hs+1−1
@@ -59,7 +59,7 @@ import Prelude hiding (length)
59--
59--
60-- > arraysOf n = Stream.foldMany (MArray.writeN n)
60-- > arraysOf n = Stream.foldMany (MArray.writeN n)
61--
61--
62−-- /Internal/
62+-- /Pre-release/
63{-# INLINE arraysOf #-}
63{-# INLINE arraysOf #-}
64arraysOf :: (IsStream t, MonadIO m, Storable a)
64arraysOf :: (IsStream t, MonadIO m, Storable a)
65 => Int -> t m a -> t m (Array a)
65 => Int -> t m a -> t m (Array a)
src/Streamly/Internal/Data/Binary/Decode.hs+12−12
@@ -43,7 +43,7 @@ import qualified Streamly.Internal.Data.Parser.ParserK.Types as PRK
43-- 0 ==> ()
43-- 0 ==> ()
44-- @
44-- @
45--
45--
46−-- /Internal/
46+-- /Pre-release/
47--
47--
48{-# INLINE unit #-}
48{-# INLINE unit #-}
49unit :: MonadCatch m => Parser m Word8 ()
49unit :: MonadCatch m => Parser m Word8 ()
@@ -62,7 +62,7 @@ word8ToBool w = Left ("Invalid Bool encoding " ++ Prelude.show w)
62-- 1 ==> True
62-- 1 ==> True
63-- @
63-- @
64--
64--
65−-- /Internal/
65+-- /Pre-release/
66--
66--
67{-# INLINE bool #-}
67{-# INLINE bool #-}
68bool :: MonadCatch m => Parser m Word8 Bool
68bool :: MonadCatch m => Parser m Word8 Bool
@@ -83,7 +83,7 @@ word8ToOrdering w = Left ("Invalid Ordering encoding " ++ Prelude.show w)
83-- 2 ==> GT
83-- 2 ==> GT
84-- @
84-- @
85--
85--
86−-- /Internal/
86+-- /Pre-release/
87--
87--
88{-# INLINE ordering #-}
88{-# INLINE ordering #-}
89ordering :: MonadCatch m => Parser m Word8 Ordering
89ordering :: MonadCatch m => Parser m Word8 Ordering
@@ -92,7 +92,7 @@ ordering = PR.either word8ToOrdering
92-- XXX should go in a Word8 parser module?
92-- XXX should go in a Word8 parser module?
93-- | Accept the input byte only if it is equal to the specified value.
93-- | Accept the input byte only if it is equal to the specified value.
94--
94--
95−-- /Internal/
95+-- /Pre-release/
96--
96--
97{-# INLINE eqWord8 #-}
97{-# INLINE eqWord8 #-}
98eqWord8 :: MonadCatch m => Word8 -> Parser m Word8 Word8
98eqWord8 :: MonadCatch m => Word8 -> Parser m Word8 Word8
@@ -100,7 +100,7 @@ eqWord8 b = PR.satisfy (== b)
100
100
101-- | Accept any byte.
101-- | Accept any byte.
102--
102--
103−-- /Internal/
103+-- /Pre-release/
104--
104--
105{-# INLINE word8 #-}
105{-# INLINE word8 #-}
106word8 :: MonadCatch m => Parser m Word8 Word8
106word8 :: MonadCatch m => Parser m Word8 Word8
@@ -127,7 +127,7 @@ word16beD = PRD.Parser step initial extract
127-- | Parse two bytes as a 'Word16', the first byte is the MSB of the Word16 and
127-- | Parse two bytes as a 'Word16', the first byte is the MSB of the Word16 and
128-- second byte is the LSB (big endian representation).
128-- second byte is the LSB (big endian representation).
129--
129--
130−-- /Internal/
130+-- /Pre-release/
131--
131--
132{-# INLINE word16be #-}
132{-# INLINE word16be #-}
133word16be :: MonadCatch m => Parser m Word8 Word16
133word16be :: MonadCatch m => Parser m Word8 Word16
@@ -152,7 +152,7 @@ word16leD = PRD.Parser step initial extract
152-- | Parse two bytes as a 'Word16', the first byte is the LSB of the Word16 and
152-- | Parse two bytes as a 'Word16', the first byte is the LSB of the Word16 and
153-- second byte is the MSB (little endian representation).
153-- second byte is the MSB (little endian representation).
154--
154--
155−-- /Internal/
155+-- /Pre-release/
156--
156--
157{-# INLINE word16le #-}
157{-# INLINE word16le #-}
158word16le :: MonadCatch m => Parser m Word8 Word16
158word16le :: MonadCatch m => Parser m Word8 Word16
@@ -179,7 +179,7 @@ word32beD = PRD.Parser step initial extract
179-- | Parse four bytes as a 'Word32', the first byte is the MSB of the Word32
179-- | Parse four bytes as a 'Word32', the first byte is the MSB of the Word32
180-- and last byte is the LSB (big endian representation).
180-- and last byte is the LSB (big endian representation).
181--
181--
182−-- /Internal/
182+-- /Pre-release/
183--
183--
184{-# INLINE word32be #-}
184{-# INLINE word32be #-}
185word32be :: MonadCatch m => Parser m Word8 Word32
185word32be :: MonadCatch m => Parser m Word8 Word32
@@ -205,7 +205,7 @@ word32leD = PRD.Parser step initial extract
205-- | Parse four bytes as a 'Word32', the first byte is the MSB of the Word32
205-- | Parse four bytes as a 'Word32', the first byte is the MSB of the Word32
206-- and last byte is the LSB (big endian representation).
206-- and last byte is the LSB (big endian representation).
207--
207--
208−-- /Internal/
208+-- /Pre-release/
209--
209--
210{-# INLINE word32le #-}
210{-# INLINE word32le #-}
211word32le :: MonadCatch m => Parser m Word8 Word32
211word32le :: MonadCatch m => Parser m Word8 Word32
@@ -232,7 +232,7 @@ word64beD = PRD.Parser step initial extract
232-- | Parse eight bytes as a 'Word64', the first byte is the MSB of the Word64
232-- | Parse eight bytes as a 'Word64', the first byte is the MSB of the Word64
233-- and last byte is the LSB (big endian representation).
233-- and last byte is the LSB (big endian representation).
234--
234--
235−-- /Internal/
235+-- /Pre-release/
236--
236--
237{-# INLINE word64be #-}
237{-# INLINE word64be #-}
238word64be :: MonadCatch m => Parser m Word8 Word64
238word64be :: MonadCatch m => Parser m Word8 Word64
@@ -258,7 +258,7 @@ word64leD = PRD.Parser step initial extract
258-- | Parse eight bytes as a 'Word64', the first byte is the MSB of the Word64
258-- | Parse eight bytes as a 'Word64', the first byte is the MSB of the Word64
259-- and last byte is the LSB (big endian representation).
259-- and last byte is the LSB (big endian representation).
260--
260--
261−-- /Internal/
261+-- /Pre-release/
262--
262--
263{-# INLINE word64le #-}
263{-# INLINE word64le #-}
264word64le :: MonadCatch m => Parser m Word8 Word64
264word64le :: MonadCatch m => Parser m Word8 Word64
@@ -270,7 +270,7 @@ word64le = PRK.toParserK word64leD
270
270
271-- | Parse eight bytes as a 'Word64' in the host byte order.
271-- | Parse eight bytes as a 'Word64' in the host byte order.
272--
272--
273−-- /Internal/
273+-- /Pre-release/
274--
274--
275{-# INLINE word64host #-}
275{-# INLINE word64host #-}
276word64host :: (MonadIO m, MonadCatch m) => Parser m Word8 Word64
276word64host :: (MonadIO m, MonadCatch m) => Parser m Word8 Word64
src/Streamly/Internal/Data/Cont.hs+1−1
@@ -19,7 +19,7 @@ import Control.Monad.Cont (runCont, cont)
19-- continuation based transformation from @[b]@ to @c@, make continuation based
19-- continuation based transformation from @[b]@ to @c@, make continuation based
20-- transformation from @[a]@ to @c@.
20-- transformation from @[a]@ to @c@.
21--
21--
22−-- /Internal/
22+-- /Pre-release/
23
23
24-- You can read the definition as:
24-- You can read the definition as:
25--
25--
src/Streamly/Internal/Data/Fold.hs+13−13
@@ -269,7 +269,7 @@ import Streamly.Internal.Data.Fold.Types
269
269
270-- | Change the underlying monad of a fold
270-- | Change the underlying monad of a fold
271--
271--
272−-- /Internal/
272+-- /Pre-release/
273hoist :: (forall x. m x -> n x) -> Fold m a b -> Fold n a b
273hoist :: (forall x. m x -> n x) -> Fold m a b -> Fold n a b
274hoist f (Fold step initial extract) =
274hoist f (Fold step initial extract) =
275 Fold (\x a -> f $ step x a) (f initial) (f . extract)
275 Fold (\x a -> f $ step x a) (f initial) (f . extract)
@@ -278,7 +278,7 @@ hoist f (Fold step initial extract) =
278--
278--
279-- > generally = hoist (return . runIdentity)
279-- > generally = hoist (return . runIdentity)
280--
280--
281−-- /Internal/
281+-- /Pre-release/
282generally :: Monad m => Fold Identity a b -> Fold m a b
282generally :: Monad m => Fold Identity a b -> Fold m a b
283generally = hoist (return . runIdentity)
283generally = hoist (return . runIdentity)
284
284
@@ -338,7 +338,7 @@ mapM = rmapM
338-- >>> Stream.fold fld (Stream.enumerateFromTo 1 10)
338-- >>> Stream.fold fld (Stream.enumerateFromTo 1 10)
339-- [2,4,6,8,10]
339-- [2,4,6,8,10]
340--
340--
341−-- /Internal/
341+-- /Pre-release/
342{-# INLINE mapMaybe #-}
342{-# INLINE mapMaybe #-}
343mapMaybe :: (Monad m) => (a -> Maybe b) -> Fold m b r -> Fold m a r
343mapMaybe :: (Monad m) => (a -> Maybe b) -> Fold m b r -> Fold m a r
344mapMaybe f = map f . filter isJust . map fromJust
344mapMaybe f = map f . filter isJust . map fromJust
@@ -656,7 +656,7 @@ rollingHashFirstN n = takeLE n rollingHash
656--
656--
657-- > S.fold (FL.sconcat 10) (S.map Sum $ S.enumerateFromTo 1 10)
657-- > S.fold (FL.sconcat 10) (S.map Sum $ S.enumerateFromTo 1 10)
658--
658--
659−-- /Internal/
659+-- /Pre-release/
660--
660--
661{-# INLINE sconcat #-}
661{-# INLINE sconcat #-}
662sconcat :: (Monad m, Semigroup a) => a -> Fold m a a
662sconcat :: (Monad m, Semigroup a) => a -> Fold m a a
@@ -973,7 +973,7 @@ or = any (== True)
973--
973--
974-- > splitAt n f1 f2 = splitWith (,) (takeLE n f1) f2
974-- > splitAt n f1 f2 = splitWith (,) (takeLE n f1) f2
975--
975--
976−-- /Internal/
976+-- /Pre-release/
977
977
978{-# INLINE splitAt #-}
978{-# INLINE splitAt #-}
979splitAt
979splitAt
@@ -1041,7 +1041,7 @@ splitAt n fld = splitWith (,) (takeLE n fld)
1041--
1041--
1042-- Stops - when the predicate succeeds.
1042-- Stops - when the predicate succeeds.
1043--
1043--
1044−-- /Internal/
1044+-- /Pre-release/
1045{-# INLINE sliceSepBy #-}
1045{-# INLINE sliceSepBy #-}
1046sliceSepBy :: Monad m => (a -> Bool) -> Fold m a b -> Fold m a b
1046sliceSepBy :: Monad m => (a -> Bool) -> Fold m a b -> Fold m a b
1047sliceSepBy predicate (Fold fstep finitial fextract) =
1047sliceSepBy predicate (Fold fstep finitial fextract) =
@@ -1062,7 +1062,7 @@ sliceSepBy predicate (Fold fstep finitial fextract) =
1062--
1062--
1063-- > Stream.splitWithSuffix pred f = Stream.foldMany (Fold.sliceEndWith pred f)
1063-- > Stream.splitWithSuffix pred f = Stream.foldMany (Fold.sliceEndWith pred f)
1064--
1064--
1065−-- /Internal/
1065+-- /Pre-release/
1066--
1066--
1067{-# INLINE sliceEndWith #-}
1067{-# INLINE sliceEndWith #-}
1068sliceEndWith :: Monad m => (a -> Bool) -> Fold m a b -> Fold m a b
1068sliceEndWith :: Monad m => (a -> Bool) -> Fold m a b -> Fold m a b
@@ -1355,7 +1355,7 @@ partition = partitionBy id
1355--
1355--
1356-- > demuxWith f kv = fmap fst $ demuxDefaultWith f kv drain
1356-- > demuxWith f kv = fmap fst $ demuxDefaultWith f kv drain
1357--
1357--
1358−-- /Internal/
1358+-- /Pre-release/
1359--
1359--
1360{-# INLINE demuxWith #-}
1360{-# INLINE demuxWith #-}
1361demuxWith :: (Monad m, Ord k)
1361demuxWith :: (Monad m, Ord k)
@@ -1394,7 +1394,7 @@ data DemuxState s b doneMap runMap =
1394--
1394--
1395-- Stops when all the folds, including the catchall fold, stop.
1395-- Stops when all the folds, including the catchall fold, stop.
1396--
1396--
1397−-- /Internal/
1397+-- /Pre-release/
1398--
1398--
1399{-# INLINE demuxDefaultWith #-}
1399{-# INLINE demuxDefaultWith #-}
1400demuxDefaultWith :: (Monad m, Ord k)
1400demuxDefaultWith :: (Monad m, Ord k)
@@ -1528,7 +1528,7 @@ demuxDefault = demuxDefaultWith id
1528--
1528--
1529-- /Stops: never/
1529-- /Stops: never/
1530--
1530--
1531−-- /Internal/
1531+-- /Pre-release/
1532--
1532--
1533{-# INLINE classifyWith #-}
1533{-# INLINE classifyWith #-}
1534classifyWith :: (Monad m, Ord k) => (a -> k) -> Fold m a b -> Fold m a (Map k b)
1534classifyWith :: (Monad m, Ord k) => (a -> k) -> Fold m a b -> Fold m a (Map k b)
@@ -1746,7 +1746,7 @@ indexed = zip (Stream.enumerateFrom 0 :: SerialT m Int)
1746-- filterWithRelTime = with timeIndexed filter
1746-- filterWithRelTime = with timeIndexed filter
1747-- @
1747-- @
1748--
1748--
1749−-- /Internal/
1749+-- /Pre-release/
1750{-# INLINE with #-}
1750{-# INLINE with #-}
1751with ::
1751with ::
1752 (Fold m (s, a) b -> Fold m a b)
1752 (Fold m (s, a) b -> Fold m a b)
@@ -1800,7 +1800,7 @@ chunksBetween _low _high _f1 _f2 = undefined
1800-- /Warning!/ working on large streams accumulated as buffers in memory could
1800-- /Warning!/ working on large streams accumulated as buffers in memory could
1801-- be very inefficient, consider using "Streamly.Data.Array" instead.
1801-- be very inefficient, consider using "Streamly.Data.Array" instead.
1802--
1802--
1803−-- /Internal/
1803+-- /Pre-release/
1804{-# INLINE toStream #-}
1804{-# INLINE toStream #-}
1805toStream :: Monad m => Fold m a (SerialT Identity a)
1805toStream :: Monad m => Fold m a (SerialT Identity a)
1806toStream = mkAccum (\f x -> f . (x `K.cons`)) id ($ K.nil)
1806toStream = mkAccum (\f x -> f . (x `K.cons`)) id ($ K.nil)
@@ -1814,7 +1814,7 @@ toStream = mkAccum (\f x -> f . (x `K.cons`)) id ($ K.nil)
1814-- /Warning!/ working on large streams accumulated as buffers in memory could
1814-- /Warning!/ working on large streams accumulated as buffers in memory could
1815-- be very inefficient, consider using "Streamly.Data.Array" instead.
1815-- be very inefficient, consider using "Streamly.Data.Array" instead.
1816--
1816--
1817−-- /Internal/
1817+-- /Pre-release/
1818
1818
1819-- xn : ... : x2 : x1 : []
1819-- xn : ... : x2 : x1 : []
1820{-# INLINABLE toStreamRev #-}
1820{-# INLINABLE toStreamRev #-}
src/Streamly/Internal/Data/Fold/Tee.hs+1−1
@@ -28,7 +28,7 @@ import qualified Streamly.Internal.Data.Fold.Types as Fold
28-- @Tee@ is a wrapper over 'Fold' that uses 'teeWith' to define the applicative
28-- @Tee@ is a wrapper over 'Fold' that uses 'teeWith' to define the applicative
29-- instance.
29-- instance.
30--
30--
31−-- /Internal/
31+-- /Pre-release/
32newtype Tee m a b =
32newtype Tee m a b =
33 Tee { runTee :: Fold m a b }
33 Tee { runTee :: Fold m a b }
34 deriving (Functor)
34 deriving (Functor)
src/Streamly/Internal/Data/Fold/Types.hs+19−18
@@ -259,7 +259,7 @@ import Prelude hiding (concatMap, filter, map)
259-- state or the driver can use @extract@ on the state to get the result out.
259-- state or the driver can use @extract@ on the state to get the result out.
260-- 'Done' returns the final result and the fold cannot be driven further.
260-- 'Done' returns the final result and the fold cannot be driven further.
261--
261--
262−-- /Internal/
262+-- /Pre-release/
263--
263--
264{-# ANN type Step Fuse #-}
264{-# ANN type Step Fuse #-}
265data Step s b
265data Step s b
@@ -269,7 +269,7 @@ data Step s b
269-- | A bifunctor instance on 'Step'. @first@ maps on the value held by 'Partial'
269-- | A bifunctor instance on 'Step'. @first@ maps on the value held by 'Partial'
270-- and @second@ maps on the result held by 'Done'.
270-- and @second@ maps on the result held by 'Done'.
271--
271--
272−-- /Internal/
272+-- /Pre-release/
273--
273--
274instance Bifunctor Step where
274instance Bifunctor Step where
275 {-# INLINE bimap #-}
275 {-# INLINE bimap #-}
@@ -289,7 +289,7 @@ instance Bifunctor Step where
289-- fmap = 'second'
289-- fmap = 'second'
290-- @
290-- @
291--
291--
292−-- /Internal/
292+-- /Pre-release/
293--
293--
294instance Functor (Step s) where
294instance Functor (Step s) where
295 {-# INLINE fmap #-}
295 {-# INLINE fmap #-}
@@ -326,7 +326,7 @@ data Fold m a b =
326-- If your 'Fold' returns only 'Partial' (i.e. never returns a 'Done') then you
326-- If your 'Fold' returns only 'Partial' (i.e. never returns a 'Done') then you
327-- can use @mkAccum*@ constructors.
327-- can use @mkAccum*@ constructors.
328--
328--
329−-- /Internal/
329+-- /Pre-release/
330--
330--
331{-# INLINE mkAccum #-}
331{-# INLINE mkAccum #-}
332mkAccum :: Monad m => (s -> a -> s) -> s -> (s -> b) -> Fold m a b
332mkAccum :: Monad m => (s -> a -> s) -> s -> (s -> b) -> Fold m a b
@@ -343,7 +343,7 @@ mkAccum step initial extract =
343-- mkAccum_ step initial = mkAccum step initial id
343-- mkAccum_ step initial = mkAccum step initial id
344-- @
344-- @
345--
345--
346−-- /Internal/
346+-- /Pre-release/
347--
347--
348{-# INLINE mkAccum_ #-}
348{-# INLINE mkAccum_ #-}
349mkAccum_ :: Monad m => (b -> a -> b) -> b -> Fold m a b
349mkAccum_ :: Monad m => (b -> a -> b) -> b -> Fold m a b
@@ -352,7 +352,7 @@ mkAccum_ step initial = mkAccum step initial id
352-- | Make an accumulating (non-terminating) fold with an effectful step
352-- | Make an accumulating (non-terminating) fold with an effectful step
353-- function, an initial state, and a state extraction function.
353-- function, an initial state, and a state extraction function.
354--
354--
355−-- /Internal/
355+-- /Pre-release/
356--
356--
357{-# INLINE mkAccumM #-}
357{-# INLINE mkAccumM #-}
358mkAccumM :: Functor m => (s -> a -> m s) -> m s -> (s -> m b) -> Fold m a b
358mkAccumM :: Functor m => (s -> a -> m s) -> m s -> (s -> m b) -> Fold m a b
@@ -366,7 +366,7 @@ mkAccumM step initial =
366-- mkAccumM_ step initial = mkAccumM step initial return
366-- mkAccumM_ step initial = mkAccumM step initial return
367-- @
367-- @
368--
368--
369−-- /Internal/
369+-- /Pre-release/
370--
370--
371{-# INLINE mkAccumM_ #-}
371{-# INLINE mkAccumM_ #-}
372mkAccumM_ :: Monad m => (b -> a -> m b) -> m b -> Fold m a b
372mkAccumM_ :: Monad m => (b -> a -> m b) -> m b -> Fold m a b
@@ -375,7 +375,7 @@ mkAccumM_ step initial = mkAccumM step initial return
375-- | Make a terminating fold using a pure step function, a pure initial state
375-- | Make a terminating fold using a pure step function, a pure initial state
376-- and a pure state extraction function.
376-- and a pure state extraction function.
377--
377--
378−-- /Internal/
378+-- /Pre-release/
379--
379--
380{-# INLINE mkFold #-}
380{-# INLINE mkFold #-}
381mkFold :: Monad m => (s -> a -> Step s b) -> Step s b -> (s -> b) -> Fold m a b
381mkFold :: Monad m => (s -> a -> Step s b) -> Step s b -> (s -> b) -> Fold m a b
@@ -389,7 +389,7 @@ mkFold step initial extract =
389-- mkFold_ step initial = mkFold step initial id
389-- mkFold_ step initial = mkFold step initial id
390-- @
390-- @
391--
391--
392−-- /Internal/
392+-- /Pre-release/
393--
393--
394{-# INLINE mkFold_ #-}
394{-# INLINE mkFold_ #-}
395mkFold_ :: Monad m => (b -> a -> Step b b) -> Step b b -> Fold m a b
395mkFold_ :: Monad m => (b -> a -> Step b b) -> Step b b -> Fold m a b
@@ -402,7 +402,7 @@ mkFold_ step initial = mkFold step initial id
402--
402--
403-- We can just use 'Fold' but it is provided for completeness.
403-- We can just use 'Fold' but it is provided for completeness.
404--
404--
405−-- /Internal/
405+-- /Pre-release/
406--
406--
407{-# INLINE mkFoldM #-}
407{-# INLINE mkFoldM #-}
408mkFoldM :: (s -> a -> m (Step s b)) -> m (Step s b) -> (s -> m b) -> Fold m a b
408mkFoldM :: (s -> a -> m (Step s b)) -> m (Step s b) -> (s -> m b) -> Fold m a b
@@ -415,7 +415,7 @@ mkFoldM = Fold
415-- mkFoldM_ step initial = mkFoldM step initial return
415-- mkFoldM_ step initial = mkFoldM step initial return
416-- @
416-- @
417--
417--
418−-- /Internal/
418+-- /Pre-release/
419--
419--
420{-# INLINE mkFoldM_ #-}
420{-# INLINE mkFoldM_ #-}
421mkFoldM_ :: Monad m => (b -> a -> m (Step b b)) -> m (Step b b) -> Fold m a b
421mkFoldM_ :: Monad m => (b -> a -> m (Step b b)) -> m (Step b b) -> Fold m a b
@@ -515,7 +515,7 @@ data SeqFoldState sl f sr = SeqFoldL !sl | SeqFoldR !f !sr
515-- 'Streamly.Prelude.serial', it splits the streams using two folds and zips
515-- 'Streamly.Prelude.serial', it splits the streams using two folds and zips
516-- the results. This has the same caveats as ParseD's @splitWith@
516-- the results. This has the same caveats as ParseD's @splitWith@
517--
517--
518−-- /Internal/
518+-- /Pre-release/
519--
519--
520{-# INLINE splitWith #-}
520{-# INLINE splitWith #-}
521splitWith :: Monad m => (a -> b -> c) -> Fold m x a -> Fold m x b -> Fold m x c
521splitWith :: Monad m => (a -> b -> c) -> Fold m x a -> Fold m x b -> Fold m x c
@@ -576,6 +576,7 @@ data GenericRunner sL sR bL bR
576-- of them terminate and combines their output using @k@.
576-- of them terminate and combines their output using @k@.
577--
577--
578-- @since 0.8.0
578-- @since 0.8.0
579+--
579{-# INLINE teeWith #-}
580{-# INLINE teeWith #-}
580teeWith :: Monad m => (a -> b -> c) -> Fold m x a -> Fold m x b -> Fold m x c
581teeWith :: Monad m => (a -> b -> c) -> Fold m x a -> Fold m x b -> Fold m x c
581teeWith f (Fold stepL beginL doneL) (Fold stepR beginR doneR) =
582teeWith f (Fold stepL beginL doneL) (Fold stepR beginR doneR) =
@@ -684,7 +685,7 @@ data ConcatMapState m sa a c
684-- >>> Stream.fold (Fold.concatMap (flip Fold.takeLE Fold.sum) (Fold.rmapM (return . fromJust) Fold.head)) $ Stream.fromList [10,9..1]
685-- >>> Stream.fold (Fold.concatMap (flip Fold.takeLE Fold.sum) (Fold.rmapM (return . fromJust) Fold.head)) $ Stream.fromList [10,9..1]
685-- 45
686-- 45
686--
687--
687−-- /Internal/
688+-- /Pre-release/
688--
689--
689{-# INLINE concatMap #-}
690{-# INLINE concatMap #-}
690concatMap :: Monad m => (b -> Fold m a c) -> Fold m a b -> Fold m a c
691concatMap :: Monad m => (b -> Fold m a c) -> Fold m a b -> Fold m a c
@@ -801,7 +802,7 @@ lcatMaybes = filter isJust . map fromJust
801-- >>> Stream.fold (Fold.takeLE (-1) Fold.toList) $ Stream.fromList [1]
802-- >>> Stream.fold (Fold.takeLE (-1) Fold.toList) $ Stream.fromList [1]
802-- []
803-- []
803--
804--
804−-- /Internal/
805+-- /Pre-release/
805--
806--
806-- @since 0.7.0
807-- @since 0.7.0
807{-# INLINE takeLE #-}
808{-# INLINE takeLE #-}
@@ -897,7 +898,7 @@ runStep (Fold step initial extract) a = return $ Fold step initial1 extract
897--
898--
898-- Stops when @collect@ stops.
899-- Stops when @collect@ stops.
899--
900--
900−-- /Internal/
901+-- /Pre-release/
901--
902--
902-- /See also: Streamly.Prelude.concatMap, Streamly.Prelude.foldMany/
903-- /See also: Streamly.Prelude.concatMap, Streamly.Prelude.foldMany/
903--
904--
@@ -957,7 +958,7 @@ many (Fold cstep cinitial cextract) (Fold sstep sinitial sextract) =
957--
958--
958-- Stops when @collect@ stops.
959-- Stops when @collect@ stops.
959--
960--
960−-- /Internal/
961+-- /Pre-release/
961--
962--
962{-# INLINE chunksOf #-}
963{-# INLINE chunksOf #-}
963chunksOf :: Monad m => Int -> Fold m a b -> Fold m b c -> Fold m a c
964chunksOf :: Monad m => Int -> Fold m a b -> Fold m b c -> Fold m a c
@@ -994,7 +995,7 @@ chunksOf2 n (Fold step1 initial1 extract1) (Fold2 step2 inject2 extract2) =
994--
995--
995-- Stops when @fold@ stops or when the timeout occurs.
996-- Stops when @fold@ stops or when the timeout occurs.
996--
997--
997−-- /Internal/
998+-- /Pre-release/
998--
999--
999{-# INLINE takeByTime #-}
1000{-# INLINE takeByTime #-}
1000takeByTime :: MonadAsync m => Double -> Fold m a b -> Fold m a b
1001takeByTime :: MonadAsync m => Double -> Fold m a b -> Fold m a b
@@ -1058,7 +1059,7 @@ takeByTime n (Fold step initial done) = Fold step' initial' done'
1058--
1059--
1059-- > intervalsOf n split collect = many collect (takeByTime n split)
1060-- > intervalsOf n split collect = many collect (takeByTime n split)
1060--
1061--
1061−-- /Internal/
1062+-- /Pre-release/
1062--
1063--
1063{-# INLINE intervalsOf #-}
1064{-# INLINE intervalsOf #-}
1064intervalsOf :: MonadAsync m => Double -> Fold m a b -> Fold m b c -> Fold m a c
1065intervalsOf :: MonadAsync m => Double -> Fold m a b -> Fold m b c -> Fold m a c
src/Streamly/Internal/Data/IOFinalizer.hs+4−4
@@ -34,7 +34,7 @@ import Streamly.Internal.Data.SVar (captureMonadState, runInIO)
34--
34--
35-- It is implemented using 'mkWeakIORef'.
35-- It is implemented using 'mkWeakIORef'.
36--
36--
37−-- /Internal/
37+-- /Pre-release/
38newtype IOFinalizer = IOFinalizer (IORef (Maybe (IO ())))
38newtype IOFinalizer = IOFinalizer (IORef (Maybe (IO ())))
39
39
40-- | Make a finalizer from a monadic action @m a@ that can run in IO monad.
40-- | Make a finalizer from a monadic action @m a@ that can run in IO monad.
@@ -65,7 +65,7 @@ runFinalizerGC ref = do
65-- finalizer is run manually before GC we could run it with the current state
65-- finalizer is run manually before GC we could run it with the current state
66-- of the monad but we want to keep both the cases consistent.
66-- of the monad but we want to keep both the cases consistent.
67--
67--
68−-- /Internal/
68+-- /Pre-release/
69newIOFinalizer :: (MonadIO m, MonadBaseControl IO m) => m a -> m IOFinalizer
69newIOFinalizer :: (MonadIO m, MonadBaseControl IO m) => m a -> m IOFinalizer
70newIOFinalizer finalizer = do
70newIOFinalizer finalizer = do
71 f <- mkIOFinalizer finalizer
71 f <- mkIOFinalizer finalizer
@@ -77,7 +77,7 @@ newIOFinalizer finalizer = do
77-- never runs again. Note, the finalizing action runs with async exceptions
77-- never runs again. Note, the finalizing action runs with async exceptions
78-- masked.
78-- masked.
79--
79--
80−-- /Internal/
80+-- /Pre-release/
81runIOFinalizer :: MonadIO m => IOFinalizer -> m ()
81runIOFinalizer :: MonadIO m => IOFinalizer -> m ()
82runIOFinalizer (IOFinalizer ref) = liftIO $ do
82runIOFinalizer (IOFinalizer ref) = liftIO $ do
83 res <- readIORef ref
83 res <- readIORef ref
@@ -94,7 +94,7 @@ runIOFinalizer (IOFinalizer ref) = liftIO $ do
94-- | Run an action clearing the finalizer atomically wrt async exceptions. The
94-- | Run an action clearing the finalizer atomically wrt async exceptions. The
95-- action is run with async exceptions masked.
95-- action is run with async exceptions masked.
96--
96--
97−-- /Internal/
97+-- /Pre-release/
98clearingIOFinalizer :: MonadBaseControl IO m => IOFinalizer -> m a -> m a
98clearingIOFinalizer :: MonadBaseControl IO m => IOFinalizer -> m a -> m a
99clearingIOFinalizer (IOFinalizer ref) action = do
99clearingIOFinalizer (IOFinalizer ref) action = do
100 control $ \runinio ->
100 control $ \runinio ->
src/Streamly/Internal/Data/IORef/Prim.hs+6−6
@@ -56,7 +56,7 @@ data IORef a = IORef (MutableByteArray# RealWorld)
56
56
57-- | Create a new 'IORef'.
57-- | Create a new 'IORef'.
58--
58--
59−-- /Internal/
59+-- /Pre-release/
60{-# INLINE newIORef #-}
60{-# INLINE newIORef #-}
61newIORef :: forall a. Prim a => a -> IO (IORef a)
61newIORef :: forall a. Prim a => a -> IO (IORef a)
62newIORef x = IO (\s# ->
62newIORef x = IO (\s# ->
@@ -68,21 +68,21 @@ newIORef x = IO (\s# ->
68
68
69-- | Write a value to an 'IORef'.
69-- | Write a value to an 'IORef'.
70--
70--
71−-- /Internal/
71+-- /Pre-release/
72{-# INLINE writeIORef #-}
72{-# INLINE writeIORef #-}
73writeIORef :: Prim a => IORef a -> a -> IO ()
73writeIORef :: Prim a => IORef a -> a -> IO ()
74writeIORef (IORef arr#) x = primitive_ (writeByteArray# arr# 0# x)
74writeIORef (IORef arr#) x = primitive_ (writeByteArray# arr# 0# x)
75
75
76-- | Read a value from an 'IORef'.
76-- | Read a value from an 'IORef'.
77--
77--
78−-- /Internal/
78+-- /Pre-release/
79{-# INLINE readIORef #-}
79{-# INLINE readIORef #-}
80readIORef :: Prim a => IORef a -> IO a
80readIORef :: Prim a => IORef a -> IO a
81readIORef (IORef arr#) = IO (readByteArray# arr# 0#)
81readIORef (IORef arr#) = IO (readByteArray# arr# 0#)
82
82
83-- | Modify the value of an 'IORef' using a function with strict application.
83-- | Modify the value of an 'IORef' using a function with strict application.
84--
84--
85−-- /Internal/
85+-- /Pre-release/
86{-# INLINE modifyIORef' #-}
86{-# INLINE modifyIORef' #-}
87modifyIORef' :: Prim a => IORef a -> (a -> a) -> IO ()
87modifyIORef' :: Prim a => IORef a -> (a -> a) -> IO ()
88modifyIORef' (IORef arr#) g = primitive_ $ \s# ->
88modifyIORef' (IORef arr#) g = primitive_ $ \s# ->
@@ -91,7 +91,7 @@ modifyIORef' (IORef arr#) g = primitive_ $ \s# ->
91
91
92-- | Generate a stream by continuously reading the IORef.
92-- | Generate a stream by continuously reading the IORef.
93--
93--
94−-- /Internal/
94+-- /Pre-release/
95{-# INLINE_NORMAL toStreamD #-}
95{-# INLINE_NORMAL toStreamD #-}
96toStreamD :: (MonadIO m, Prim a) => IORef a -> D.Stream m a
96toStreamD :: (MonadIO m, Prim a) => IORef a -> D.Stream m a
97toStreamD var = D.Stream step ()
97toStreamD var = D.Stream step ()
@@ -103,7 +103,7 @@ toStreamD var = D.Stream step ()
103
103
104-- | Construct a stream by reading a 'Prim' 'IORef' repeatedly.
104-- | Construct a stream by reading a 'Prim' 'IORef' repeatedly.
105--
105--
106−-- /Internal/
106+-- /Pre-release/
107--
107--
108{-# INLINE toStream #-}
108{-# INLINE toStream #-}
109toStream :: (K.IsStream t, MonadIO m, Prim a) => IORef a -> t m a
109toStream :: (K.IsStream t, MonadIO m, Prim a) => IORef a -> t m a
src/Streamly/Internal/Data/Parser.hs+33−33
@@ -221,7 +221,7 @@ import qualified Streamly.Internal.Data.Parser.ParserK.Types as K
221--
221--
222-- | Make a 'Parser' from a 'Fold'.
222-- | Make a 'Parser' from a 'Fold'.
223--
223--
224−-- /Internal/
224+-- /Pre-release/
225--
225--
226{-# INLINE fromFold #-}
226{-# INLINE fromFold #-}
227fromFold :: MonadCatch m => Fold m a b -> Parser m a b
227fromFold :: MonadCatch m => Fold m a b -> Parser m a b
@@ -235,7 +235,7 @@ fromFold = K.toParserK . D.fromFold
235--
235--
236-- | A parser that always yields a pure value without consuming any input.
236-- | A parser that always yields a pure value without consuming any input.
237--
237--
238−-- /Internal/
238+-- /Pre-release/
239--
239--
240{-# INLINE [3] yield #-}
240{-# INLINE [3] yield #-}
241yield :: MonadCatch m => b -> Parser m a b
241yield :: MonadCatch m => b -> Parser m a b
@@ -248,7 +248,7 @@ yield = K.toParserK . D.yield
248-- | A parser that always yields the result of an effectful action without
248-- | A parser that always yields the result of an effectful action without
249-- consuming any input.
249-- consuming any input.
250--
250--
251−-- /Internal/
251+-- /Pre-release/
252--
252--
253{-# INLINE yieldM #-}
253{-# INLINE yieldM #-}
254yieldM :: MonadCatch m => m b -> Parser m a b
254yieldM :: MonadCatch m => m b -> Parser m a b
@@ -259,7 +259,7 @@ yieldM = K.yieldM -- K.toParserK . D.yieldM
259-- | A parser that always fails with an error message without consuming
259-- | A parser that always fails with an error message without consuming
260-- any input.
260-- any input.
261--
261--
262−-- /Internal/
262+-- /Pre-release/
263--
263--
264{-# INLINE [3] die #-}
264{-# INLINE [3] die #-}
265die :: MonadCatch m => String -> Parser m a b
265die :: MonadCatch m => String -> Parser m a b
@@ -272,7 +272,7 @@ die = K.toParserK . D.die
272-- | A parser that always fails with an effectful error message and without
272-- | A parser that always fails with an effectful error message and without
273-- consuming any input.
273-- consuming any input.
274--
274--
275−-- /Internal/
275+-- /Pre-release/
276--
276--
277{-# INLINE dieM #-}
277{-# INLINE dieM #-}
278dieM :: MonadCatch m => m String -> Parser m a b
278dieM :: MonadCatch m => m String -> Parser m a b
@@ -292,7 +292,7 @@ dieM = K.toParserK . D.dieM
292-- peek = lookAhead (satisfy True)
292-- peek = lookAhead (satisfy True)
293-- @
293-- @
294--
294--
295−-- /Internal/
295+-- /Pre-release/
296--
296--
297{-# INLINE peek #-}
297{-# INLINE peek #-}
298peek :: MonadCatch m => Parser m a a
298peek :: MonadCatch m => Parser m a a
@@ -303,7 +303,7 @@ peek = K.toParserK D.peek
303-- >>> Stream.parse ((,) <$> Parser.satisfy (> 0) <*> Parser.eof) $ Stream.fromList [1]
303-- >>> Stream.parse ((,) <$> Parser.satisfy (> 0) <*> Parser.eof) $ Stream.fromList [1]
304-- (1,())
304-- (1,())
305--
305--
306−-- /Internal/
306+-- /Pre-release/
307--
307--
308{-# INLINE eof #-}
308{-# INLINE eof #-}
309eof :: MonadCatch m => Parser m a ()
309eof :: MonadCatch m => Parser m a ()
@@ -314,7 +314,7 @@ eof = K.toParserK D.eof
314-- >>> Stream.parse (Parser.satisfy (== 1)) $ Stream.fromList [1,0,1]
314-- >>> Stream.parse (Parser.satisfy (== 1)) $ Stream.fromList [1,0,1]
315-- 1
315-- 1
316--
316--
317−-- /Internal/
317+-- /Pre-release/
318--
318--
319{-# INLINE satisfy #-}
319{-# INLINE satisfy #-}
320satisfy :: MonadCatch m => (a -> Bool) -> Parser m a a
320satisfy :: MonadCatch m => (a -> Bool) -> Parser m a a
@@ -324,7 +324,7 @@ satisfy = K.toParserK . D.satisfy
324-- parser fails if the function returns 'Nothing' otherwise returns the 'Just'
324-- parser fails if the function returns 'Nothing' otherwise returns the 'Just'
325-- value.
325-- value.
326--
326--
327−-- /Internal/
327+-- /Pre-release/
328--
328--
329{-# INLINE maybe #-}
329{-# INLINE maybe #-}
330maybe :: MonadCatch m => (a -> Maybe b) -> Parser m a b
330maybe :: MonadCatch m => (a -> Maybe b) -> Parser m a b
@@ -334,7 +334,7 @@ maybe = K.toParserK . D.maybe
334-- the function returns 'Left err', the parser fails with the error message
334-- the function returns 'Left err', the parser fails with the error message
335-- @err@ otherwise returns the 'Right' value.
335-- @err@ otherwise returns the 'Right' value.
336--
336--
337−-- /Internal/
337+-- /Pre-release/
338--
338--
339{-# INLINE either #-}
339{-# INLINE either #-}
340either :: MonadCatch m => (a -> Either String b) -> Parser m a b
340either :: MonadCatch m => (a -> Either String b) -> Parser m a b
@@ -385,7 +385,7 @@ either = K.toParserK . D.either
385-- takeGE = takeBetween n maxBound
385-- takeGE = takeBetween n maxBound
386-- @
386-- @
387--
387--
388−-- /Internal/
388+-- /Pre-release/
389--
389--
390{-# INLINE takeBetween #-}
390{-# INLINE takeBetween #-}
391takeBetween :: MonadCatch m =>
391takeBetween :: MonadCatch m =>
@@ -401,7 +401,7 @@ takeBetween m n = K.toParserK . D.takeBetween m n
401-- >>> Stream.parse (Parser.takeEQ 4 Fold.toList) $ Stream.fromList [1,0,1]
401-- >>> Stream.parse (Parser.takeEQ 4 Fold.toList) $ Stream.fromList [1,0,1]
402-- *** Exception: ParseError "takeEQ: Expecting exactly 4 elements, input terminated on 3"
402-- *** Exception: ParseError "takeEQ: Expecting exactly 4 elements, input terminated on 3"
403--
403--
404−-- /Internal/
404+-- /Pre-release/
405--
405--
406{-# INLINE takeEQ #-}
406{-# INLINE takeEQ #-}
407takeEQ :: MonadCatch m => Int -> Fold m a b -> Parser m a b
407takeEQ :: MonadCatch m => Int -> Fold m a b -> Parser m a b
@@ -419,7 +419,7 @@ takeEQ n = K.toParserK . D.takeEQ n
419-- >>> Stream.parse (Parser.takeGE 4 Fold.toList) $ Stream.fromList [1,0,1,0,1]
419-- >>> Stream.parse (Parser.takeGE 4 Fold.toList) $ Stream.fromList [1,0,1,0,1]
420-- [1,0,1,0,1]
420-- [1,0,1,0,1]
421--
421--
422−-- /Internal/
422+-- /Pre-release/
423--
423--
424{-# INLINE takeGE #-}
424{-# INLINE takeGE #-}
425takeGE :: MonadCatch m => Int -> Fold m a b -> Parser m a b
425takeGE :: MonadCatch m => Int -> Fold m a b -> Parser m a b
@@ -464,7 +464,7 @@ takeWhileP _cond = undefined -- K.toParserK . D.takeWhileP cond
464-- breakOn p = takeWhile (not p)
464-- breakOn p = takeWhile (not p)
465-- @
465-- @
466--
466--
467−-- /Internal/
467+-- /Pre-release/
468--
468--
469{-# INLINE takeWhile #-}
469{-# INLINE takeWhile #-}
470takeWhile :: MonadCatch m => (a -> Bool) -> Fold m a b -> Parser m a b
470takeWhile :: MonadCatch m => (a -> Bool) -> Fold m a b -> Parser m a b
@@ -472,7 +472,7 @@ takeWhile cond = K.toParserK . D.takeWhile cond
472
472
473-- | Like 'takeWhile' but takes at least one element otherwise fails.
473-- | Like 'takeWhile' but takes at least one element otherwise fails.
474--
474--
475−-- /Internal/
475+-- /Pre-release/
476--
476--
477{-# INLINE takeWhile1 #-}
477{-# INLINE takeWhile1 #-}
478takeWhile1 :: MonadCatch m => (a -> Bool) -> Fold m a b -> Parser m a b
478takeWhile1 :: MonadCatch m => (a -> Bool) -> Fold m a b -> Parser m a b
@@ -483,7 +483,7 @@ takeWhile1 cond = K.toParserK . D.takeWhile1 cond
483--
483--
484-- This is also called @skipWhile@ in some parsing libraries.
484-- This is also called @skipWhile@ in some parsing libraries.
485--
485--
486−-- /Internal/
486+-- /Pre-release/
487--
487--
488{-# INLINE drainWhile #-}
488{-# INLINE drainWhile #-}
489drainWhile :: MonadCatch m => (a -> Bool) -> Parser m a ()
489drainWhile :: MonadCatch m => (a -> Bool) -> Parser m a ()
@@ -500,7 +500,7 @@ drainWhile p = takeWhile p FL.drain
500-- sliceSepByBetween cond m n p = sliceSepByP cond (takeBetween m n p)
500-- sliceSepByBetween cond m n p = sliceSepByP cond (takeBetween m n p)
501-- @
501-- @
502--
502--
503−-- /Internal/
503+-- /Pre-release/
504--
504--
505{-# INLINABLE sliceSepByP #-}
505{-# INLINABLE sliceSepByP #-}
506sliceSepByP ::
506sliceSepByP ::
@@ -549,7 +549,7 @@ sliceSepWith _cond = undefined -- K.toParserK . D.sliceSepBy cond
549-- >>> sliceBeginWithOdd []
549-- >>> sliceBeginWithOdd []
550-- []
550-- []
551--
551--
552−-- /Internal/
552+-- /Pre-release/
553--
553--
554{-# INLINABLE sliceBeginWith #-}
554{-# INLINABLE sliceBeginWith #-}
555sliceBeginWith ::
555sliceBeginWith ::
@@ -638,7 +638,7 @@ wordBy f = K.toParserK . D.wordBy f
638-- >>> runGroupsBy (<) [3, 5, 4, 1, 2, 0]
638-- >>> runGroupsBy (<) [3, 5, 4, 1, 2, 0]
639-- [[3,5,4],[1,2],[0]]
639-- [[3,5,4],[1,2],[0]]
640--
640--
641−-- /Internal/
641+-- /Pre-release/
642--
642--
643{-# INLINABLE groupBy #-}
643{-# INLINABLE groupBy #-}
644groupBy :: MonadCatch m => (a -> a -> Bool) -> Fold m a b -> Parser m a b
644groupBy :: MonadCatch m => (a -> a -> Bool) -> Fold m a b -> Parser m a b
@@ -672,7 +672,7 @@ groupBy eq = K.toParserK . D.groupBy eq
672-- >>> runGroupsByRolling (<) [3, 5, 4, 1, 2, 0]
672-- >>> runGroupsByRolling (<) [3, 5, 4, 1, 2, 0]
673-- [[3,5],[4],[1,2],[0]]
673-- [[3,5],[4],[1,2],[0]]
674--
674--
675−-- /Internal/
675+-- /Pre-release/
676--
676--
677{-# INLINABLE groupByRolling #-}
677{-# INLINABLE groupByRolling #-}
678groupByRolling :: MonadCatch m => (a -> a -> Bool) -> Fold m a b -> Parser m a b
678groupByRolling :: MonadCatch m => (a -> a -> Bool) -> Fold m a b -> Parser m a b
@@ -685,7 +685,7 @@ groupByRolling eq = K.toParserK . D.groupByRolling eq
685-- >>> Stream.parse (Parser.eqBy (==) "mismatch") $ Stream.fromList "match"
685-- >>> Stream.parse (Parser.eqBy (==) "mismatch") $ Stream.fromList "match"
686-- *** Exception: ParseError "eqBy: failed, yet to match 7 elements"
686-- *** Exception: ParseError "eqBy: failed, yet to match 7 elements"
687--
687--
688−-- /Internal/
688+-- /Pre-release/
689--
689--
690{-# INLINE eqBy #-}
690{-# INLINE eqBy #-}
691eqBy :: MonadCatch m => (a -> a -> Bool) -> [a] -> Parser m a ()
691eqBy :: MonadCatch m => (a -> a -> Bool) -> [a] -> Parser m a ()
@@ -735,7 +735,7 @@ eqBy cmp = K.toParserK . D.eqBy cmp
735-- spanByRolling eq f1 f2 = splitWith (,) ('groupByRolling' eq f1) ('fromFold' f2)
735-- spanByRolling eq f1 f2 = splitWith (,) ('groupByRolling' eq f1) ('fromFold' f2)
736-- @
736-- @
737--
737--
738−-- /Internal/
738+-- /Pre-release/
739--
739--
740{-# INLINE splitWith #-}
740{-# INLINE splitWith #-}
741splitWith :: MonadCatch m
741splitWith :: MonadCatch m
@@ -761,7 +761,7 @@ splitWith f p1 p2 =
761-- operations, and can be faster than 'Applicative' instance for small
761-- operations, and can be faster than 'Applicative' instance for small
762-- number (less than 8) of compositions.
762-- number (less than 8) of compositions.
763--
763--
764−-- /Internal/
764+-- /Pre-release/
765--
765--
766{-# INLINE split_ #-}
766{-# INLINE split_ #-}
767split_ :: MonadCatch m => Parser m x a -> Parser m x b -> Parser m x b
767split_ :: MonadCatch m => Parser m x a -> Parser m x b -> Parser m x b
@@ -771,7 +771,7 @@ split_ p1 p2 = K.toParserK $ D.split_ (K.fromParserK p1) (K.fromParserK p2)
771-- of them succeed or anyone of them fails and combines their output using @f@.
771-- of them succeed or anyone of them fails and combines their output using @f@.
772-- The parser succeeds if both the parsers succeed.
772-- The parser succeeds if both the parsers succeed.
773--
773--
774−-- /Internal/
774+-- /Pre-release/
775--
775--
776{-# INLINE teeWith #-}
776{-# INLINE teeWith #-}
777teeWith :: MonadCatch m
777teeWith :: MonadCatch m
@@ -782,7 +782,7 @@ teeWith f p1 p2 =
782-- | Like 'teeWith' but ends parsing and zips the results, if available,
782-- | Like 'teeWith' but ends parsing and zips the results, if available,
783-- whenever the first parser ends.
783-- whenever the first parser ends.
784--
784--
785−-- /Internal/
785+-- /Pre-release/
786--
786--
787{-# INLINE teeWithFst #-}
787{-# INLINE teeWithFst #-}
788teeWithFst :: MonadCatch m
788teeWithFst :: MonadCatch m
@@ -816,7 +816,7 @@ teeWithMin f p1 p2 =
816-- operations and can be much faster than 'Alternative' instance for small
816-- operations and can be much faster than 'Alternative' instance for small
817-- number (less than 8) of alternatives.
817-- number (less than 8) of alternatives.
818--
818--
819−-- /Internal/
819+-- /Pre-release/
820--
820--
821{-# INLINE alt #-}
821{-# INLINE alt #-}
822alt :: MonadCatch m => Parser m x a -> Parser m x a -> Parser m x a
822alt :: MonadCatch m => Parser m x a -> Parser m x a -> Parser m x a
@@ -826,7 +826,7 @@ alt p1 p2 = K.toParserK $ D.alt (K.fromParserK p1) (K.fromParserK p2)
826-- from the one which consumed least input i.e. take the shortest succeeding
826-- from the one which consumed least input i.e. take the shortest succeeding
827-- parse.
827-- parse.
828--
828--
829−-- /Internal/
829+-- /Pre-release/
830--
830--
831{-# INLINE shortest #-}
831{-# INLINE shortest #-}
832shortest :: MonadCatch m
832shortest :: MonadCatch m
@@ -837,7 +837,7 @@ shortest p1 p2 = K.toParserK $ D.shortest (K.fromParserK p1) (K.fromParserK p2)
837-- from the one which consumed more input i.e. take the longest succeeding
837-- from the one which consumed more input i.e. take the longest succeeding
838-- parse.
838-- parse.
839--
839--
840−-- /Internal/
840+-- /Pre-release/
841--
841--
842{-# INLINE longest #-}
842{-# INLINE longest #-}
843longest :: MonadCatch m
843longest :: MonadCatch m
@@ -846,7 +846,7 @@ longest p1 p2 = K.toParserK $ D.longest (K.fromParserK p1) (K.fromParserK p2)
846
846
847-- | Run a parser without consuming the input.
847-- | Run a parser without consuming the input.
848--
848--
849−-- /Internal/
849+-- /Pre-release/
850--
850--
851{-# INLINE lookAhead #-}
851{-# INLINE lookAhead #-}
852lookAhead :: MonadCatch m => Parser m a b -> Parser m a b
852lookAhead :: MonadCatch m => Parser m a b -> Parser m a b
@@ -913,7 +913,7 @@ concatSequence _f _p = undefined
913-- operations and can be much faster than 'Monad' instance for small number
913-- operations and can be much faster than 'Monad' instance for small number
914-- (less than 8) of compositions.
914-- (less than 8) of compositions.
915--
915--
916−-- /Internal/
916+-- /Pre-release/
917--
917--
918{-# INLINE concatMap #-}
918{-# INLINE concatMap #-}
919concatMap :: MonadCatch m
919concatMap :: MonadCatch m
@@ -964,7 +964,7 @@ manyP _f _p = undefined -- K.toParserK $ D.manyP f (K.fromParserK p)
964--
964--
965-- Compare with 'Control.Applicative.many'.
965-- Compare with 'Control.Applicative.many'.
966--
966--
967−-- /Internal/
967+-- /Pre-release/
968--
968--
969{-# INLINE many #-}
969{-# INLINE many #-}
970many :: MonadCatch m => Fold m b c -> Parser m a b -> Parser m a c
970many :: MonadCatch m => Fold m b c -> Parser m a b -> Parser m a c
@@ -985,7 +985,7 @@ many f p = K.toParserK $ D.many f (K.fromParserK p)
985--
985--
986-- Compare with 'Control.Applicative.some'.
986-- Compare with 'Control.Applicative.some'.
987--
987--
988−-- /Internal/
988+-- /Pre-release/
989--
989--
990{-# INLINE some #-}
990{-# INLINE some #-}
991some :: MonadCatch m => Fold m b c -> Parser m a b -> Parser m a c
991some :: MonadCatch m => Fold m b c -> Parser m a b -> Parser m a c
@@ -1044,7 +1044,7 @@ manyTillP _f _p1 _p2 = undefined
1044--
1044--
1045-- Stops when the fold @f@ stops.
1045-- Stops when the fold @f@ stops.
1046--
1046--
1047−-- /Internal/
1047+-- /Pre-release/
1048--
1048--
1049{-# INLINE manyTill #-}
1049{-# INLINE manyTill #-}
1050manyTill :: MonadCatch m
1050manyTill :: MonadCatch m
src/Streamly/Internal/Data/Parser/ParserD.hs+21−21
@@ -188,7 +188,7 @@ import Streamly.Internal.Data.Parser.ParserD.Types
188--
188--
189-- | See 'Streamly.Internal.Data.Parser.fromFold'.
189-- | See 'Streamly.Internal.Data.Parser.fromFold'.
190--
190--
191−-- /Internal/
191+-- /Pre-release/
192--
192--
193{-# INLINE fromFold #-}
193{-# INLINE fromFold #-}
194fromFold :: Monad m => Fold m a b -> Parser m a b
194fromFold :: Monad m => Fold m a b -> Parser m a b
@@ -216,7 +216,7 @@ fromFold (Fold fstep finitial fextract) = Parser step initial fextract
216
216
217-- | See 'Streamly.Internal.Data.Parser.peek'.
217-- | See 'Streamly.Internal.Data.Parser.peek'.
218--
218--
219−-- /Internal/
219+-- /Pre-release/
220--
220--
221{-# INLINABLE peek #-}
221{-# INLINABLE peek #-}
222peek :: MonadThrow m => Parser m a a
222peek :: MonadThrow m => Parser m a a
@@ -232,7 +232,7 @@ peek = Parser step initial extract
232
232
233-- | See 'Streamly.Internal.Data.Parser.eof'.
233-- | See 'Streamly.Internal.Data.Parser.eof'.
234--
234--
235−-- /Internal/
235+-- /Pre-release/
236--
236--
237{-# INLINABLE eof #-}
237{-# INLINABLE eof #-}
238eof :: Monad m => Parser m a ()
238eof :: Monad m => Parser m a ()
@@ -246,7 +246,7 @@ eof = Parser step initial return
246
246
247-- | See 'Streamly.Internal.Data.Parser.satisfy'.
247-- | See 'Streamly.Internal.Data.Parser.satisfy'.
248--
248--
249−-- /Internal/
249+-- /Pre-release/
250--
250--
251{-# INLINE satisfy #-}
251{-# INLINE satisfy #-}
252satisfy :: MonadThrow m => (a -> Bool) -> Parser m a a
252satisfy :: MonadThrow m => (a -> Bool) -> Parser m a a
@@ -265,7 +265,7 @@ satisfy predicate = Parser step initial extract
265
265
266-- | See 'Streamly.Internal.Data.Parser.maybe'.
266-- | See 'Streamly.Internal.Data.Parser.maybe'.
267--
267--
268−-- /Internal/
268+-- /Pre-release/
269--
269--
270{-# INLINE maybe #-}
270{-# INLINE maybe #-}
271maybe :: MonadThrow m => (a -> Maybe b) -> Parser m a b
271maybe :: MonadThrow m => (a -> Maybe b) -> Parser m a b
@@ -284,7 +284,7 @@ maybe parser = Parser step initial extract
284
284
285-- | See 'Streamly.Internal.Data.Parser.either'.
285-- | See 'Streamly.Internal.Data.Parser.either'.
286--
286--
287−-- /Internal/
287+-- /Pre-release/
288--
288--
289{-# INLINE either #-}
289{-# INLINE either #-}
290either :: MonadThrow m => (a -> Either String b) -> Parser m a b
290either :: MonadThrow m => (a -> Either String b) -> Parser m a b
@@ -307,7 +307,7 @@ either parser = Parser step initial extract
307
307
308-- | See 'Streamly.Internal.Data.Parser.takeBetween'.
308-- | See 'Streamly.Internal.Data.Parser.takeBetween'.
309--
309--
310−-- /Internal/
310+-- /Pre-release/
311--
311--
312{-# INLINE takeBetween #-}
312{-# INLINE takeBetween #-}
313takeBetween :: MonadCatch m => Int -> Int -> Fold m a b -> Parser m a b
313takeBetween :: MonadCatch m => Int -> Int -> Fold m a b -> Parser m a b
@@ -371,7 +371,7 @@ takeBetween low high (Fold fstep finitial fextract) =
371
371
372-- | See 'Streamly.Internal.Data.Parser.takeEQ'.
372-- | See 'Streamly.Internal.Data.Parser.takeEQ'.
373--
373--
374−-- /Internal/
374+-- /Pre-release/
375--
375--
376{-# INLINE takeEQ #-}
376{-# INLINE takeEQ #-}
377takeEQ :: MonadThrow m => Int -> Fold m a b -> Parser m a b
377takeEQ :: MonadThrow m => Int -> Fold m a b -> Parser m a b
@@ -427,7 +427,7 @@ takeEQ n (Fold fstep finitial fextract) = Parser step initial extract
427
427
428-- | See 'Streamly.Internal.Data.Parser.takeGE'.
428-- | See 'Streamly.Internal.Data.Parser.takeGE'.
429--
429--
430−-- /Internal/
430+-- /Pre-release/
431--
431--
432{-# INLINE takeGE #-}
432{-# INLINE takeGE #-}
433takeGE :: MonadThrow m => Int -> Fold m a b -> Parser m a b
433takeGE :: MonadThrow m => Int -> Fold m a b -> Parser m a b
@@ -479,7 +479,7 @@ takeGE n (Fold fstep finitial fextract) = Parser step initial extract
479
479
480-- | See 'Streamly.Internal.Data.Parser.takeWhile'.
480-- | See 'Streamly.Internal.Data.Parser.takeWhile'.
481--
481--
482−-- /Internal/
482+-- /Pre-release/
483--
483--
484{-# INLINE takeWhile #-}
484{-# INLINE takeWhile #-}
485takeWhile :: Monad m => (a -> Bool) -> Fold m a b -> Parser m a b
485takeWhile :: Monad m => (a -> Bool) -> Fold m a b -> Parser m a b
@@ -506,7 +506,7 @@ takeWhile predicate (Fold fstep finitial fextract) =
506
506
507-- | See 'Streamly.Internal.Data.Parser.takeWhile1'.
507-- | See 'Streamly.Internal.Data.Parser.takeWhile1'.
508--
508--
509−-- /Internal/
509+-- /Pre-release/
510--
510--
511{-# INLINE takeWhile1 #-}
511{-# INLINE takeWhile1 #-}
512takeWhile1 :: MonadThrow m => (a -> Bool) -> Fold m a b -> Parser m a b
512takeWhile1 :: MonadThrow m => (a -> Bool) -> Fold m a b -> Parser m a b
@@ -548,7 +548,7 @@ takeWhile1 predicate (Fold fstep finitial fextract) =
548
548
549-- | See 'Streamly.Internal.Data.Parser.sliceSepByP'.
549-- | See 'Streamly.Internal.Data.Parser.sliceSepByP'.
550--
550--
551−-- /Internal/
551+-- /Pre-release/
552--
552--
553sliceSepByP :: MonadCatch m =>
553sliceSepByP :: MonadCatch m =>
554 (a -> Bool) -> Parser m a b -> Parser m a b
554 (a -> Bool) -> Parser m a b -> Parser m a b
@@ -569,7 +569,7 @@ sliceSepByP cond (Parser pstep pinitial pextract) =
569
569
570-- | See 'Streamly.Internal.Data.Parser.sliceBeginWith'.
570-- | See 'Streamly.Internal.Data.Parser.sliceBeginWith'.
571--
571--
572−-- /Internal/
572+-- /Pre-release/
573--
573--
574data SliceBeginWithState s = Left' s | Right' s
574data SliceBeginWithState s = Left' s | Right' s
575
575
@@ -729,7 +729,7 @@ groupByRolling eq (Fold fstep finitial fextract) = Parser step initial extract
729--
729--
730-- | See 'Streamly.Internal.Data.Parser.eqBy'.
730-- | See 'Streamly.Internal.Data.Parser.eqBy'.
731--
731--
732−-- /Internal/
732+-- /Pre-release/
733--
733--
734{-# INLINE eqBy #-}
734{-# INLINE eqBy #-}
735eqBy :: MonadThrow m => (a -> a -> Bool) -> [a] -> Parser m a ()
735eqBy :: MonadThrow m => (a -> a -> Bool) -> [a] -> Parser m a ()
@@ -781,7 +781,7 @@ eqBy cmp str = Parser step initial extract
781--
781--
782-- @
782-- @
783--
783--
784−-- /Internal/
784+-- /Pre-release/
785{-# INLINE span #-}
785{-# INLINE span #-}
786span :: Monad m => (a -> Bool) -> Fold m a b -> Fold m a c -> Parser m a (b, c)
786span :: Monad m => (a -> Bool) -> Fold m a b -> Fold m a c -> Parser m a (b, c)
787span p f1 f2 = noErrorUnsafeSplitWith (,) (takeWhile p f1) (fromFold f2)
787span p f1 f2 = noErrorUnsafeSplitWith (,) (takeWhile p f1) (fromFold f2)
@@ -790,7 +790,7 @@ span p f1 f2 = noErrorUnsafeSplitWith (,) (takeWhile p f1) (fromFold f2)
790-- long as the predicate applied to the first element of the stream and next
790-- long as the predicate applied to the first element of the stream and next
791-- input element holds 'True', the second group takes the rest of the input.
791-- input element holds 'True', the second group takes the rest of the input.
792--
792--
793−-- /Internal/
793+-- /Pre-release/
794--
794--
795{-# INLINE spanBy #-}
795{-# INLINE spanBy #-}
796spanBy ::
796spanBy ::
@@ -801,7 +801,7 @@ spanBy eq f1 f2 = noErrorUnsafeSplitWith (,) (groupBy eq f1) (fromFold f2)
801-- | Like 'spanBy' but applies the predicate in a rolling fashion i.e.
801-- | Like 'spanBy' but applies the predicate in a rolling fashion i.e.
802-- predicate is applied to the previous and the next input elements.
802-- predicate is applied to the previous and the next input elements.
803--
803--
804−-- /Internal/
804+-- /Pre-release/
805{-# INLINE spanByRolling #-}
805{-# INLINE spanByRolling #-}
806spanByRolling ::
806spanByRolling ::
807 Monad m
807 Monad m
@@ -815,7 +815,7 @@ spanByRolling eq f1 f2 =
815
815
816-- | See 'Streamly.Internal.Data.Parser.lookahead'.
816-- | See 'Streamly.Internal.Data.Parser.lookahead'.
817--
817--
818−-- /Internal/
818+-- /Pre-release/
819--
819--
820{-# INLINE lookAhead #-}
820{-# INLINE lookAhead #-}
821lookAhead :: MonadThrow m => Parser m a b -> Parser m a b
821lookAhead :: MonadThrow m => Parser m a b -> Parser m a b
@@ -899,7 +899,7 @@ choice _ps = undefined
899--
899--
900-- | See 'Streamly.Internal.Data.Parser.many'.
900-- | See 'Streamly.Internal.Data.Parser.many'.
901--
901--
902−-- /Internal/
902+-- /Pre-release/
903--
903--
904{-# INLINE many #-}
904{-# INLINE many #-}
905many :: MonadCatch m => Fold m b c -> Parser m a b -> Parser m a c
905many :: MonadCatch m => Fold m b c -> Parser m a b -> Parser m a c
@@ -908,7 +908,7 @@ many = splitMany
908
908
909-- | See 'Streamly.Internal.Data.Parser.some'.
909-- | See 'Streamly.Internal.Data.Parser.some'.
910--
910--
911−-- /Internal/
911+-- /Pre-release/
912--
912--
913{-# INLINE some #-}
913{-# INLINE some #-}
914some :: MonadCatch m => Fold m b c -> Parser m a b -> Parser m a c
914some :: MonadCatch m => Fold m b c -> Parser m a b -> Parser m a c
@@ -944,7 +944,7 @@ data ManyTillState fs sr sl
944
944
945-- | See 'Streamly.Internal.Data.Parser.manyTill'.
945-- | See 'Streamly.Internal.Data.Parser.manyTill'.
946--
946--
947−-- /Internal/
947+-- /Pre-release/
948--
948--
949{-# INLINE manyTill #-}
949{-# INLINE manyTill #-}
950manyTill :: MonadCatch m
950manyTill :: MonadCatch m
src/Streamly/Internal/Data/Parser/ParserD/Types.hs+13−13
@@ -222,7 +222,7 @@ instance Functor (Initial s) where
222-- result left it at. The parser must ensure that the backtrack position is
222-- result left it at. The parser must ensure that the backtrack position is
223-- always after that.
223-- always after that.
224--
224--
225−-- /Internal/
225+-- /Pre-release/
226--
226--
227{-# ANN type Step Fuse #-}
227{-# ANN type Step Fuse #-}
228data Step s b =
228data Step s b =
@@ -272,7 +272,7 @@ instance Functor (Step s) where
272-- At any point of time the driver can call @extract@ to inspect the result of
272-- At any point of time the driver can call @extract@ to inspect the result of
273-- the fold. It may result in an error or an output value.
273-- the fold. It may result in an error or an output value.
274--
274--
275−-- /Internal/
275+-- /Pre-release/
276--
276--
277data Parser m a b =
277data Parser m a b =
278 forall s. Parser (s -> a -> m (Step s b)) (m (Initial s b)) (s -> m b)
278 forall s. Parser (s -> a -> m (Step s b)) (m (Initial s b)) (s -> m b)
@@ -283,7 +283,7 @@ data Parser m a b =
283-- this exception.
283-- this exception.
284-- * When the "extract" function of a parser needs to throw an error.
284-- * When the "extract" function of a parser needs to throw an error.
285--
285--
286−-- /Internal/
286+-- /Pre-release/
287--
287--
288newtype ParseError = ParseError String
288newtype ParseError = ParseError String
289 deriving Show
289 deriving Show
@@ -304,7 +304,7 @@ instance Functor m => Functor (Parser m a) where
304
304
305-- | See 'Streamly.Internal.Data.Parser.yield'.
305-- | See 'Streamly.Internal.Data.Parser.yield'.
306--
306--
307−-- /Internal/
307+-- /Pre-release/
308--
308--
309{-# INLINE_NORMAL yield #-}
309{-# INLINE_NORMAL yield #-}
310yield :: Monad m => b -> Parser m a b
310yield :: Monad m => b -> Parser m a b
@@ -312,7 +312,7 @@ yield b = Parser undefined (pure $ IDone b) undefined
312
312
313-- | See 'Streamly.Internal.Data.Parser.yieldM'.
313-- | See 'Streamly.Internal.Data.Parser.yieldM'.
314--
314--
315−-- /Internal/
315+-- /Pre-release/
316--
316--
317{-# INLINE yieldM #-}
317{-# INLINE yieldM #-}
318yieldM :: Monad m => m b -> Parser m a b
318yieldM :: Monad m => m b -> Parser m a b
@@ -334,7 +334,7 @@ data SeqParseState sl f sr = SeqParseL sl | SeqParseR f sr
334-- compositions the performance starts dipping rapidly beyond a CPS style
334-- compositions the performance starts dipping rapidly beyond a CPS style
335-- unfused implementation.
335-- unfused implementation.
336--
336--
337−-- /Internal/
337+-- /Pre-release/
338--
338--
339{-# INLINE splitWith #-}
339{-# INLINE splitWith #-}
340splitWith :: MonadThrow m
340splitWith :: MonadThrow m
@@ -460,7 +460,7 @@ data SeqAState sl sr = SeqAL sl | SeqAR sr
460-- This turns out to be slightly faster than splitWith
460-- This turns out to be slightly faster than splitWith
461-- | See 'Streamly.Internal.Data.Parser.split_'.
461-- | See 'Streamly.Internal.Data.Parser.split_'.
462--
462--
463−-- /Internal/
463+-- /Pre-release/
464--
464--
465{-# INLINE split_ #-}
465{-# INLINE split_ #-}
466split_ :: MonadThrow m => Parser m x a -> Parser m x b -> Parser m x b
466split_ :: MonadThrow m => Parser m x a -> Parser m x b -> Parser m x b
@@ -543,7 +543,7 @@ data AltParseState sl sr = AltParseL Int sl | AltParseR sr
543--
543--
544-- | See 'Streamly.Internal.Data.Parser.alt'.
544-- | See 'Streamly.Internal.Data.Parser.alt'.
545--
545--
546−-- /Internal/
546+-- /Pre-release/
547--
547--
548{-# INLINE alt #-}
548{-# INLINE alt #-}
549alt :: Monad m => Parser m x a -> Parser m x a -> Parser m x a
549alt :: Monad m => Parser m x a -> Parser m x a -> Parser m x a
@@ -598,7 +598,7 @@ alt (Parser stepL initialL extractL) (Parser stepR initialR extractR) =
598
598
599-- | See documentation of 'Streamly.Internal.Data.Parser.many'.
599-- | See documentation of 'Streamly.Internal.Data.Parser.many'.
600--
600--
601−-- /Internal/
601+-- /Pre-release/
602--
602--
603{-# INLINE splitMany #-}
603{-# INLINE splitMany #-}
604splitMany :: MonadCatch m => Fold m b c -> Parser m a b -> Parser m a c
604splitMany :: MonadCatch m => Fold m b c -> Parser m a b -> Parser m a c
@@ -658,7 +658,7 @@ splitMany (Fold fstep finitial fextract) (Parser step1 initial1 extract1) =
658
658
659-- | See documentation of 'Streamly.Internal.Data.Parser.some'.
659-- | See documentation of 'Streamly.Internal.Data.Parser.some'.
660--
660--
661−-- /Internal/
661+-- /Pre-release/
662--
662--
663{-# INLINE splitSome #-}
663{-# INLINE splitSome #-}
664splitSome :: MonadCatch m => Fold m b c -> Parser m a b -> Parser m a c
664splitSome :: MonadCatch m => Fold m b c -> Parser m a b -> Parser m a c
@@ -751,7 +751,7 @@ splitSome (Fold fstep finitial fextract) (Parser step1 initial1 extract1) =
751
751
752-- | See 'Streamly.Internal.Data.Parser.die'.
752-- | See 'Streamly.Internal.Data.Parser.die'.
753--
753--
754−-- /Internal/
754+-- /Pre-release/
755--
755--
756{-# INLINE_NORMAL die #-}
756{-# INLINE_NORMAL die #-}
757die :: MonadThrow m => String -> Parser m a b
757die :: MonadThrow m => String -> Parser m a b
@@ -759,7 +759,7 @@ die err = Parser undefined (pure (IError err)) undefined
759
759
760-- | See 'Streamly.Internal.Data.Parser.dieM'.
760-- | See 'Streamly.Internal.Data.Parser.dieM'.
761--
761--
762−-- /Internal/
762+-- /Pre-release/
763--
763--
764{-# INLINE dieM #-}
764{-# INLINE dieM #-}
765dieM :: MonadThrow m => m String -> Parser m a b
765dieM :: MonadThrow m => m String -> Parser m a b
@@ -801,7 +801,7 @@ data ConcatParseState sl m a b =
801
801
802-- | See 'Streamly.Internal.Data.Parser.concatMap'.
802-- | See 'Streamly.Internal.Data.Parser.concatMap'.
803--
803--
804−-- /Internal/
804+-- /Pre-release/
805--
805--
806{-# INLINE concatMap #-}
806{-# INLINE concatMap #-}
807concatMap :: MonadThrow m =>
807concatMap :: MonadThrow m =>
src/Streamly/Internal/Data/Parser/ParserK/Types.hs+9−9
@@ -48,7 +48,7 @@ import qualified Streamly.Internal.Data.Parser.ParserD.Types as D
48-- | The parse driver result. The driver may stop with a final result, pause
48-- | The parse driver result. The driver may stop with a final result, pause
49-- with a continuation to resume, or fail with an error.
49-- with a continuation to resume, or fail with an error.
50--
50--
51−-- /Internal/
51+-- /Pre-release/
52--
52--
53data Driver m a r =
53data Driver m a r =
54 Stop !Int r
54 Stop !Int r
@@ -66,7 +66,7 @@ instance Functor m => Functor (Driver m a) where
66
66
67-- The parser's result.
67-- The parser's result.
68--
68--
69−-- /Internal/
69+-- /Pre-release/
70--
70--
71data Parse b =
71data Parse b =
72 Done !Int !b -- Done, no more input needed
72 Done !Int !b -- Done, no more input needed
@@ -179,7 +179,7 @@ parseDToK pstep initial extract leftover (level, count) cont = do
179
179
180-- | Convert a direct style 'D.Parser' to a CPS style 'Parser'.
180-- | Convert a direct style 'D.Parser' to a CPS style 'Parser'.
181--
181--
182−-- /Internal/
182+-- /Pre-release/
183--
183--
184{-# INLINE_LATE toParserK #-}
184{-# INLINE_LATE toParserK #-}
185toParserK :: MonadCatch m => D.Parser m a b -> Parser m a b
185toParserK :: MonadCatch m => D.Parser m a b -> Parser m a b
@@ -200,7 +200,7 @@ parserDone _ (Error e) = return $ Failed e
200
200
201-- | When there is no more input to feed, extract the result from the Parser.
201-- | When there is no more input to feed, extract the result from the Parser.
202--
202--
203−-- /Internal/
203+-- /Pre-release/
204--
204--
205extractParse :: MonadThrow m => (Maybe a -> m (Driver m a b)) -> m b
205extractParse :: MonadThrow m => (Maybe a -> m (Driver m a b)) -> m b
206extractParse cont = do
206extractParse cont = do
@@ -218,7 +218,7 @@ data FromParserK b c = FPKDone !Int !b | FPKCont c
218-- "initial" returns a continuation which can be called one input at a time
218-- "initial" returns a continuation which can be called one input at a time
219-- using the "step" function.
219-- using the "step" function.
220--
220--
221−-- /Internal/
221+-- /Pre-release/
222--
222--
223{-# INLINE_LATE fromParserK #-}
223{-# INLINE_LATE fromParserK #-}
224fromParserK :: MonadThrow m => Parser m a b -> D.Parser m a b
224fromParserK :: MonadThrow m => Parser m a b -> D.Parser m a b
@@ -279,7 +279,7 @@ instance Functor m => Functor (Parser m a) where
279--
279--
280-- | A parser that always yields a pure value without consuming any input.
280-- | A parser that always yields a pure value without consuming any input.
281--
281--
282−-- /Internal/
282+-- /Pre-release/
283--
283--
284{-# INLINE yield #-}
284{-# INLINE yield #-}
285yield :: b -> Parser m a b
285yield :: b -> Parser m a b
@@ -287,7 +287,7 @@ yield b = MkParser $ \lo st yieldk -> yieldk st (Done lo b)
287
287
288-- | See 'Streamly.Internal.Data.Parser.yieldM'.
288-- | See 'Streamly.Internal.Data.Parser.yieldM'.
289--
289--
290−-- /Internal/
290+-- /Pre-release/
291--
291--
292{-# INLINE yieldM #-}
292{-# INLINE yieldM #-}
293yieldM :: Monad m => m b -> Parser m a b
293yieldM :: Monad m => m b -> Parser m a b
@@ -333,7 +333,7 @@ instance Monad m => Applicative (Parser m a) where
333-- | A parser that always fails with an error message without consuming
333-- | A parser that always fails with an error message without consuming
334-- any input.
334-- any input.
335--
335--
336−-- /Internal/
336+-- /Pre-release/
337--
337--
338{-# INLINE die #-}
338{-# INLINE die #-}
339die :: String -> Parser m a b
339die :: String -> Parser m a b
@@ -457,7 +457,7 @@ instance Monad m => Alternative (Parser m a) where
457-- | 'mzero' is same as 'empty', it aborts the parser. 'mplus' is same as
457-- | 'mzero' is same as 'empty', it aborts the parser. 'mplus' is same as
458-- '<|>', it selects the first succeeding parser.
458-- '<|>', it selects the first succeeding parser.
459--
459--
460−-- /Internal/
460+-- /Pre-release/
461--
461--
462instance Monad m => MonadPlus (Parser m a) where
462instance Monad m => MonadPlus (Parser m a) where
463 {-# INLINE mzero #-}
463 {-# INLINE mzero #-}
src/Streamly/Internal/Data/Producer.hs+2−2
@@ -61,7 +61,7 @@ import Prelude hiding (concat)
61
61
62-- | Simplify a producer to an unfold.
62-- | Simplify a producer to an unfold.
63--
63--
64−-- /Internal/
64+-- /Pre-release/
65{-# INLINE simplify #-}
65{-# INLINE simplify #-}
66simplify :: Producer m a b -> Unfold m a b
66simplify :: Producer m a b -> Unfold m a b
67simplify (Producer step inject _) = Unfold step inject
67simplify (Producer step inject _) = Unfold step inject
@@ -72,7 +72,7 @@ simplify (Producer step inject _) = Unfold step inject
72
72
73-- | Convert a StreamD stream into a producer.
73-- | Convert a StreamD stream into a producer.
74--
74--
75−-- /Internal/
75+-- /Pre-release/
76{-# INLINE_NORMAL fromStreamD #-}
76{-# INLINE_NORMAL fromStreamD #-}
77fromStreamD :: Monad m => Producer m (Stream m a) a
77fromStreamD :: Monad m => Producer m (Stream m a) a
78fromStreamD = Producer step return return
78fromStreamD = Producer step return return
src/Streamly/Internal/Data/Producer/Source.hs+5−5
@@ -53,14 +53,14 @@ data Source a b = Source [b] (Maybe a)
53
53
54-- | Make a source from a seed value. The buffer would start as empty.
54-- | Make a source from a seed value. The buffer would start as empty.
55--
55--
56−-- /Internal/
56+-- /Pre-release/
57source :: Maybe a -> Source a b
57source :: Maybe a -> Source a b
58source = Source []
58source = Source []
59
59
60-- | Return some unused data back to the source. The data is prepended (or
60-- | Return some unused data back to the source. The data is prepended (or
61-- consed) to the source.
61-- consed) to the source.
62--
62--
63−-- /Internal/
63+-- /Pre-release/
64unread :: [b] -> Source a b -> Source a b
64unread :: [b] -> Source a b -> Source a b
65unread xs (Source ys seed) = Source (xs ++ ys) seed
65unread xs (Source ys seed) = Source (xs ++ ys) seed
66
66
@@ -72,7 +72,7 @@ isEmpty _ = False
72-- | Convert a producer to a producer from a buffered source. Any buffered data
72-- | Convert a producer to a producer from a buffered source. Any buffered data
73-- is read first and then the seed is unfolded.
73-- is read first and then the seed is unfolded.
74--
74--
75−-- /Internal/
75+-- /Pre-release/
76{-# INLINE_NORMAL producer #-}
76{-# INLINE_NORMAL producer #-}
77producer :: Monad m => Producer m a b -> Producer m (Source a b) b
77producer :: Monad m => Producer m a b -> Producer m (Source a b) b
78producer (Producer step1 inject1 extract1) = Producer step inject extract
78producer (Producer step1 inject1 extract1) = Producer step inject extract
@@ -195,7 +195,7 @@ parseD
195-- | Parse a buffered source using a parser, returning the parsed value and the
195-- | Parse a buffered source using a parser, returning the parsed value and the
196-- remaining source.
196-- remaining source.
197--
197--
198−-- /Internal/
198+-- /Pre-release/
199{-# INLINE [3] parse #-}
199{-# INLINE [3] parse #-}
200parse
200parse
201 :: MonadThrow m
201 :: MonadThrow m
@@ -229,7 +229,7 @@ parseManyD parser reader = Producer step return return
229-- | Apply a parser repeatedly on a buffered source producer to generate a
229-- | Apply a parser repeatedly on a buffered source producer to generate a
230-- producer of parsed values.
230-- producer of parsed values.
231--
231--
232−-- /Internal/
232+-- /Pre-release/
233{-# INLINE parseMany #-}
233{-# INLINE parseMany #-}
234parseMany :: MonadThrow m =>
234parseMany :: MonadThrow m =>
235 ParserK.Parser m a b
235 ParserK.Parser m a b
src/Streamly/Internal/Data/Producer/Type.hs+6−6
@@ -43,7 +43,7 @@ import Prelude hiding (concat, map)
43-- | A @Producer m a b@ is a generator of a stream of values of type @b@ from a
43-- | A @Producer m a b@ is a generator of a stream of values of type @b@ from a
44-- seed of type 'a' in 'Monad' @m@.
44-- seed of type 'a' in 'Monad' @m@.
45--
45--
46−-- /Internal/
46+-- /Pre-release/
47
47
48data Producer m a b =
48data Producer m a b =
49 -- | @Producer step inject extract@
49 -- | @Producer step inject extract@
@@ -81,7 +81,7 @@ unfoldrM next = Producer step return return
81
81
82-- | Convert a list of pure values to a 'Stream'
82-- | Convert a list of pure values to a 'Stream'
83--
83--
84−-- /Internal/
84+-- /Pre-release/
85{-# INLINE_LATE fromList #-}
85{-# INLINE_LATE fromList #-}
86fromList :: Monad m => Producer m [a] a
86fromList :: Monad m => Producer m [a] a
87fromList = Producer step return return
87fromList = Producer step return return
@@ -98,7 +98,7 @@ fromList = Producer step return return
98
98
99-- | Interconvert the producer between two interconvertible input types.
99-- | Interconvert the producer between two interconvertible input types.
100--
100--
101−-- /Internal/
101+-- /Pre-release/
102{-# INLINE_NORMAL translate #-}
102{-# INLINE_NORMAL translate #-}
103translate :: Functor m =>
103translate :: Functor m =>
104 (a -> c) -> (c -> a) -> Producer m c b -> Producer m a b
104 (a -> c) -> (c -> a) -> Producer m c b -> Producer m a b
@@ -107,7 +107,7 @@ translate f g (Producer step inject extract) =
107
107
108-- | Map the producer input to another value of the same type.
108-- | Map the producer input to another value of the same type.
109--
109--
110−-- /Internal/
110+-- /Pre-release/
111{-# INLINE_NORMAL lmap #-}
111{-# INLINE_NORMAL lmap #-}
112lmap :: (a -> a) -> Producer m a b -> Producer m a b
112lmap :: (a -> a) -> Producer m a b -> Producer m a b
113lmap f (Producer step inject extract) = Producer step (inject . f) extract
113lmap f (Producer step inject extract) = Producer step (inject . f) extract
@@ -118,7 +118,7 @@ lmap f (Producer step inject extract) = Producer step (inject . f) extract
118
118
119-- | Map a function on the output of the producer (the type @b@).
119-- | Map a function on the output of the producer (the type @b@).
120--
120--
121−-- /Internal/
121+-- /Pre-release/
122{-# INLINE_NORMAL map #-}
122{-# INLINE_NORMAL map #-}
123map :: Functor m => (b -> c) -> Producer m a b -> Producer m a c
123map :: Functor m => (b -> c) -> Producer m a b -> Producer m a c
124map f (Producer ustep uinject uextract) = Producer step uinject uextract
124map f (Producer ustep uinject uextract) = Producer step uinject uextract
@@ -144,7 +144,7 @@ data NestedLoop s1 s2 = OuterLoop s1 | InnerLoop s1 s2
144-- | Apply the second unfold to each output element of the first unfold and
144-- | Apply the second unfold to each output element of the first unfold and
145-- flatten the output in a single stream.
145-- flatten the output in a single stream.
146--
146--
147−-- /Internal/
147+-- /Pre-release/
148--
148--
149{-# INLINE_NORMAL concat #-}
149{-# INLINE_NORMAL concat #-}
150concat :: Monad m =>
150concat :: Monad m =>
src/Streamly/Internal/Data/Stream/Async.hs+2−2
@@ -491,7 +491,7 @@ newAsyncVar st m = do
491-- | Generate a stream asynchronously to keep it buffered, lazily consume
491-- | Generate a stream asynchronously to keep it buffered, lazily consume
492-- from the buffer.
492-- from the buffer.
493--
493--
494−-- /Internal/
494+-- /Pre-release/
495--
495--
496{-# INLINABLE mkAsyncK #-}
496{-# INLINABLE mkAsyncK #-}
497mkAsyncK :: (IsStream t, MonadAsync m) => t m a -> t m a
497mkAsyncK :: (IsStream t, MonadAsync m) => t m a -> t m a
@@ -525,7 +525,7 @@ mkAsyncD m = D.Stream step Nothing
525-- kicked off again to evaluate the remaining stream when there is space in the
525-- kicked off again to evaluate the remaining stream when there is space in the
526-- buffer. The consumer consumes the stream lazily from the buffer.
526-- buffer. The consumer consumes the stream lazily from the buffer.
527--
527--
528−-- /Internal/
528+-- /Pre-release/
529--
529--
530{-# INLINE_NORMAL mkAsync #-}
530{-# INLINE_NORMAL mkAsync #-}
531mkAsync :: (K.IsStream t, MonadAsync m) => t m a -> t m a
531mkAsync :: (K.IsStream t, MonadAsync m) => t m a -> t m a
src/Streamly/Internal/Data/Stream/IsStream/Combinators.hs+1−1
@@ -224,7 +224,7 @@ printState st = liftIO $ do
224
224
225-- | Print debug information about an SVar when the stream ends
225-- | Print debug information about an SVar when the stream ends
226--
226--
227−-- /Internal/
227+-- /Pre-release/
228--
228--
229inspectMode :: IsStream t => t m a -> t m a
229inspectMode :: IsStream t => t m a -> t m a
230inspectMode m = mkStream $ \st stp sng yld ->
230inspectMode m = mkStream $ \st stp sng yld ->
src/Streamly/Internal/Data/Stream/IsStream/Common.hs+8−8
@@ -177,7 +177,7 @@ repeatMSerial = fromStreamS . S.repeatM
177--
177--
178-- Note: This API is not safe on 32-bit machines.
178-- Note: This API is not safe on 32-bit machines.
179--
179--
180−-- /Internal/
180+-- /Pre-release/
181--
181--
182{-# INLINE timesWith #-}
182{-# INLINE timesWith #-}
183timesWith :: (IsStream t, MonadAsync m) => Double -> t m (AbsTime, RelTime64)
183timesWith :: (IsStream t, MonadAsync m) => Double -> t m (AbsTime, RelTime64)
@@ -195,7 +195,7 @@ timesWith g = fromStreamD $ D.times g
195--
195--
196-- Note: This API is not safe on 32-bit machines.
196-- Note: This API is not safe on 32-bit machines.
197--
197--
198−-- /Internal/
198+-- /Pre-release/
199--
199--
200{-# INLINE absTimesWith #-}
200{-# INLINE absTimesWith #-}
201absTimesWith :: (IsStream t, MonadAsync m, Functor (t m))
201absTimesWith :: (IsStream t, MonadAsync m, Functor (t m))
@@ -214,7 +214,7 @@ absTimesWith = fmap (uncurry addToAbsTime64) . timesWith
214--
214--
215-- Note: This API is not safe on 32-bit machines.
215-- Note: This API is not safe on 32-bit machines.
216--
216--
217−-- /Internal/
217+-- /Pre-release/
218--
218--
219{-# INLINE relTimesWith #-}
219{-# INLINE relTimesWith #-}
220relTimesWith :: (IsStream t, MonadAsync m, Functor (t m))
220relTimesWith :: (IsStream t, MonadAsync m, Functor (t m))
@@ -263,7 +263,7 @@ fold = P.foldOnce
263-- scan and release it when the stream ends or to flush the internal state of
263-- scan and release it when the stream ends or to flush the internal state of
264-- the scan at the end.
264-- the scan at the end.
265--
265--
266−-- /Internal/
266+-- /Pre-release/
267--
267--
268{-# INLINE scanlMAfter' #-}
268{-# INLINE scanlMAfter' #-}
269scanlMAfter' :: (IsStream t, Monad m)
269scanlMAfter' :: (IsStream t, Monad m)
@@ -306,7 +306,7 @@ postscanlM' step z m = fromStreamD $ D.postscanlM' step z $ toStreamD m
306--
306--
307-- See also: 'scanlM''
307-- See also: 'scanlM''
308--
308--
309−-- /Internal/
309+-- /Pre-release/
310--
310--
311{-# INLINE smapM #-}
311{-# INLINE smapM #-}
312smapM :: (IsStream t, Monad m) =>
312smapM :: (IsStream t, Monad m) =>
@@ -393,7 +393,7 @@ intersperseM m = fromStreamS . S.intersperseM m . toStreamS
393-- h,e,l,l,o
393-- h,e,l,l,o
394-- @
394-- @
395--
395--
396−-- /Internal/
396+-- /Pre-release/
397{-# INLINE interjectSuffix #-}
397{-# INLINE interjectSuffix #-}
398interjectSuffix
398interjectSuffix
399 :: (IsStream t, MonadAsync m)
399 :: (IsStream t, MonadAsync m)
@@ -425,7 +425,7 @@ reverse s = fromStreamS $ S.reverse $ toStreamS s
425
425
426-- | Like 'reverse' but several times faster, requires a 'Storable' instance.
426-- | Like 'reverse' but several times faster, requires a 'Storable' instance.
427--
427--
428−-- /Internal/
428+-- /Pre-release/
429{-# INLINE reverse' #-}
429{-# INLINE reverse' #-}
430reverse' :: (IsStream t, MonadIO m, Storable a) => t m a -> t m a
430reverse' :: (IsStream t, MonadIO m, Storable a) => t m a -> t m a
431reverse' s = fromStreamD $ D.reverse' $ toStreamD s
431reverse' s = fromStreamD $ D.reverse' $ toStreamD s
@@ -508,7 +508,7 @@ concatM generator = concatMapM (\() -> generator) (yield ())
508--
508--
509-- > splitOn . intercalate == id
509-- > splitOn . intercalate == id
510--
510--
511−-- /Internal/
511+-- /Pre-release/
512
512
513-- XXX We can use a polymorphic vector implemented by Array# to represent the
513-- XXX We can use a polymorphic vector implemented by Array# to represent the
514-- sequence, that way we can avoid the Storable constraint. If we still need
514-- sequence, that way we can avoid the Storable constraint. If we still need
src/Streamly/Internal/Data/Stream/IsStream/Eliminate.hs+10−10
@@ -334,7 +334,7 @@ runSink = fold . toFold
334
334
335-- | Parse a stream using the supplied 'Parser'.
335-- | Parse a stream using the supplied 'Parser'.
336--
336--
337−-- /Internal/
337+-- /Pre-release/
338--
338--
339{-# INLINE_NORMAL parseD #-}
339{-# INLINE_NORMAL parseD #-}
340parseD :: MonadThrow m => PRD.Parser m a b -> SerialT m a -> m b
340parseD :: MonadThrow m => PRD.Parser m a b -> SerialT m a -> m b
@@ -360,7 +360,7 @@ parseK = parse
360--
360--
361-- @parse p@ is not the same as @head . parseMany p@ on an empty stream.
361-- @parse p@ is not the same as @head . parseMany p@ on an empty stream.
362--
362--
363−-- /Internal/
363+-- /Pre-release/
364--
364--
365{-# INLINE [3] parse #-}
365{-# INLINE [3] parse #-}
366parse :: MonadThrow m => Parser m a b -> SerialT m a -> m b
366parse :: MonadThrow m => Parser m a b -> SerialT m a -> m b
@@ -473,7 +473,7 @@ head = S.head . toStreamS
473-- supplied default value. It can help avoid one branch in high performance
473-- supplied default value. It can help avoid one branch in high performance
474-- code.
474-- code.
475--
475--
476−-- /Internal/
476+-- /Pre-release/
477{-# INLINE headElse #-}
477{-# INLINE headElse #-}
478headElse :: Monad m => a -> SerialT m a -> m a
478headElse :: Monad m => a -> SerialT m a -> m a
479headElse x = D.headElse x . toStreamD
479headElse x = D.headElse x . toStreamD
@@ -591,7 +591,7 @@ product = foldl' (*) 1
591--
591--
592-- > mconcat = fold Fold.mconcat
592-- > mconcat = fold Fold.mconcat
593--
593--
594−-- /Internal/
594+-- /Pre-release/
595{-# INLINE mconcat #-}
595{-# INLINE mconcat #-}
596mconcat :: (Monad m, Monoid a) => SerialT m a -> m a
596mconcat :: (Monad m, Monoid a) => SerialT m a -> m a
597mconcat = foldr mappend mempty
597mconcat = foldr mappend mempty
@@ -740,7 +740,7 @@ toList = P.toList
740-- /Warning!/ working on large lists accumulated as buffers in memory could be
740-- /Warning!/ working on large lists accumulated as buffers in memory could be
741-- very inefficient, consider using "Streamly.Array" instead.
741-- very inefficient, consider using "Streamly.Array" instead.
742--
742--
743−-- /Internal/
743+-- /Pre-release/
744{-# INLINE toListRev #-}
744{-# INLINE toListRev #-}
745toListRev :: Monad m => SerialT m a -> m [a]
745toListRev :: Monad m => SerialT m a -> m [a]
746toListRev = D.toListRev . toStreamD
746toListRev = D.toListRev . toStreamD
@@ -770,7 +770,7 @@ toHandle h = go
770-- toStream = foldr cons nil
770-- toStream = foldr cons nil
771-- @
771-- @
772--
772--
773−-- /Internal/
773+-- /Pre-release/
774--
774--
775{-# INLINE toStream #-}
775{-# INLINE toStream #-}
776toStream :: Monad m => SerialT m a -> m (SerialT Identity a)
776toStream :: Monad m => SerialT m a -> m (SerialT Identity a)
@@ -782,7 +782,7 @@ toStream = foldr K.cons K.nil
782-- toStreamRev = foldl' (flip cons) nil
782-- toStreamRev = foldl' (flip cons) nil
783-- @
783-- @
784--
784--
785−-- /Internal/
785+-- /Pre-release/
786--
786--
787{-# INLINE toStreamRev #-}
787{-# INLINE toStreamRev #-}
788toStreamRev :: Monad m => SerialT m a -> m (SerialT Identity a)
788toStreamRev :: Monad m => SerialT m a -> m (SerialT Identity a)
@@ -876,7 +876,7 @@ isPrefixOf m1 m2 = D.isPrefixOf (toStreamD m1) (toStreamD m2)
876--
876--
877-- Space: @O(n)@ worst case where @n@ is the length of the infix.
877-- Space: @O(n)@ worst case where @n@ is the length of the infix.
878--
878--
879−-- /Internal/
879+-- /Pre-release/
880--
880--
881-- /Requires 'Storable' constraint/ - Help wanted.
881-- /Requires 'Storable' constraint/ - Help wanted.
882--
882--
@@ -915,7 +915,7 @@ isInfixOf infx stream = do
915--
915--
916-- Space: @O(n)@, buffers entire input stream and the suffix.
916-- Space: @O(n)@, buffers entire input stream and the suffix.
917--
917--
918−-- /Internal/
918+-- /Pre-release/
919--
919--
920-- /Suboptimal/ - Help wanted.
920-- /Suboptimal/ - Help wanted.
921--
921--
@@ -970,7 +970,7 @@ stripPrefix m1 m2 = fmap fromStreamD <$>
970--
970--
971-- Space: @O(n)@, buffers the entire input stream as well as the suffix
971-- Space: @O(n)@, buffers the entire input stream as well as the suffix
972--
972--
973−-- /Internal/
973+-- /Pre-release/
974{-# INLINE stripSuffix #-}
974{-# INLINE stripSuffix #-}
975stripSuffix
975stripSuffix
976 :: (Monad m, Eq a)
976 :: (Monad m, Eq a)
src/Streamly/Internal/Data/Stream/IsStream/Exception.hs+4−4
@@ -55,7 +55,7 @@ before action xs = D.fromStreamD $ D.before action $ D.toStreamD xs
55--
55--
56-- > after_ action xs = xs <> 'nilM' action
56-- > after_ action xs = xs <> 'nilM' action
57--
57--
58−-- /Internal/
58+-- /Pre-release/
59--
59--
60{-# INLINE after_ #-}
60{-# INLINE after_ #-}
61after_ :: (IsStream t, Monad m) => m b -> t m a -> t m a
61after_ :: (IsStream t, Monad m) => m b -> t m a -> t m a
@@ -95,7 +95,7 @@ onException action xs = D.fromStreamD $ D.onException action $ D.toStreamD xs
95--
95--
96-- /Inhibits stream fusion/
96-- /Inhibits stream fusion/
97--
97--
98−-- /Internal/
98+-- /Pre-release/
99--
99--
100{-# INLINE finally_ #-}
100{-# INLINE finally_ #-}
101finally_ :: (IsStream t, MonadCatch m) => m b -> t m a -> t m a
101finally_ :: (IsStream t, MonadCatch m) => m b -> t m a -> t m a
@@ -132,7 +132,7 @@ finally action xs = D.fromStreamD $ D.finally action $ D.toStreamD xs
132--
132--
133-- /Inhibits stream fusion/
133-- /Inhibits stream fusion/
134--
134--
135−-- /Internal/
135+-- /Pre-release/
136--
136--
137{-# INLINE bracket_ #-}
137{-# INLINE bracket_ #-}
138bracket_ :: (IsStream t, MonadCatch m)
138bracket_ :: (IsStream t, MonadCatch m)
@@ -179,7 +179,7 @@ bracket bef aft bet = D.fromStreamD $
179--
179--
180-- /Inhibits stream fusion/
180-- /Inhibits stream fusion/
181--
181--
182−-- /Internal/
182+-- /Pre-release/
183--
183--
184{-# INLINE ghandle #-}
184{-# INLINE ghandle #-}
185ghandle :: (IsStream t, MonadCatch m, Exception e)
185ghandle :: (IsStream t, MonadCatch m, Exception e)
src/Streamly/Internal/Data/Stream/IsStream/Generate.hs+5−5
@@ -142,7 +142,7 @@ unfold unf x = fromStreamD $ D.unfold unf x
142
142
143-- | Convert an 'Unfold' with a closed input end into a stream.
143-- | Convert an 'Unfold' with a closed input end into a stream.
144--
144--
145−-- /Internal/
145+-- /Pre-release/
146{-# INLINE unfold0 #-}
146{-# INLINE unfold0 #-}
147unfold0 :: (IsStream t, Monad m) => Unfold m Void b -> t m b
147unfold0 :: (IsStream t, Monad m) => Unfold m Void b -> t m b
148unfold0 unf = unfold unf (error "unfold0: unexpected void evaluation")
148unfold0 unf = unfold unf (error "unfold0: unexpected void evaluation")
@@ -296,7 +296,7 @@ replicateMSerial n = fromStreamS . S.replicateM n
296--
296--
297-- Note: This API is not safe on 32-bit machines.
297-- Note: This API is not safe on 32-bit machines.
298--
298--
299−-- /Internal/
299+-- /Pre-release/
300--
300--
301{-# INLINE times #-}
301{-# INLINE times #-}
302times :: (IsStream t, MonadAsync m) => t m (AbsTime, RelTime64)
302times :: (IsStream t, MonadAsync m) => t m (AbsTime, RelTime64)
@@ -312,7 +312,7 @@ times = timesWith 0.01
312--
312--
313-- Note: This API is not safe on 32-bit machines.
313-- Note: This API is not safe on 32-bit machines.
314--
314--
315−-- /Internal/
315+-- /Pre-release/
316--
316--
317{-# INLINE absTimes #-}
317{-# INLINE absTimes #-}
318absTimes :: (IsStream t, MonadAsync m, Functor (t m)) => t m AbsTime
318absTimes :: (IsStream t, MonadAsync m, Functor (t m)) => t m AbsTime
@@ -334,7 +334,7 @@ currentTime = absTimesWith
334--
334--
335-- Note: This API is not safe on 32-bit machines.
335-- Note: This API is not safe on 32-bit machines.
336--
336--
337−-- /Internal/
337+-- /Pre-release/
338--
338--
339{-# INLINE relTimes #-}
339{-# INLINE relTimes #-}
340relTimes :: (IsStream t, MonadAsync m, Functor (t m)) => t m RelTime64
340relTimes :: (IsStream t, MonadAsync m, Functor (t m)) => t m RelTime64
@@ -559,7 +559,7 @@ fromHandle h = go
559-- callback when invoked adds a value at the tail of the stream. Returns a
559-- callback when invoked adds a value at the tail of the stream. Returns a
560-- stream of values generated by the callback.
560-- stream of values generated by the callback.
561--
561--
562−-- /Internal/
562+-- /Pre-release/
563--
563--
564{-# INLINE fromCallback #-}
564{-# INLINE fromCallback #-}
565fromCallback :: MonadAsync m => ((a -> m ()) -> m ()) -> SerialT m a
565fromCallback :: MonadAsync m => ((a -> m ()) -> m ()) -> SerialT m a
src/Streamly/Internal/Data/Stream/IsStream/Nesting.hs+37−37
@@ -328,7 +328,7 @@ import Prelude hiding (zipWith, concatMap, concat)
328-- but use 'concatMap' or 'concatMapWith serial' for appending @n@ streams or
328-- but use 'concatMap' or 'concatMapWith serial' for appending @n@ streams or
329-- infinite containers of streams.
329-- infinite containers of streams.
330--
330--
331−-- /Internal/
331+-- /Pre-release/
332{-# INLINE append #-}
332{-# INLINE append #-}
333append ::(IsStream t, Monad m) => t m b -> t m b -> t m b
333append ::(IsStream t, Monad m) => t m b -> t m b -> t m b
334append m1 m2 = fromStreamD $ D.append (toStreamD m1) (toStreamD m2)
334append m1 m2 = fromStreamD $ D.append (toStreamD m1) (toStreamD m2)
@@ -360,7 +360,7 @@ append m1 m2 = fromStreamD $ D.append (toStreamD m1) (toStreamD m2)
360--
360--
361-- Do not use at scale in concatMapWith.
361-- Do not use at scale in concatMapWith.
362--
362--
363−-- /Internal/
363+-- /Pre-release/
364{-# INLINE interleave #-}
364{-# INLINE interleave #-}
365interleave ::(IsStream t, Monad m) => t m b -> t m b -> t m b
365interleave ::(IsStream t, Monad m) => t m b -> t m b -> t m b
366interleave m1 m2 = fromStreamD $ D.interleave (toStreamD m1) (toStreamD m2)
366interleave m1 m2 = fromStreamD $ D.interleave (toStreamD m1) (toStreamD m2)
@@ -383,7 +383,7 @@ interleave m1 m2 = fromStreamD $ D.interleave (toStreamD m1) (toStreamD m2)
383--
383--
384-- Do not use at scale in concatMapWith.
384-- Do not use at scale in concatMapWith.
385--
385--
386−-- /Internal/
386+-- /Pre-release/
387{-# INLINE interleaveSuffix #-}
387{-# INLINE interleaveSuffix #-}
388interleaveSuffix ::(IsStream t, Monad m) => t m b -> t m b -> t m b
388interleaveSuffix ::(IsStream t, Monad m) => t m b -> t m b -> t m b
389interleaveSuffix m1 m2 =
389interleaveSuffix m1 m2 =
@@ -407,7 +407,7 @@ interleaveSuffix m1 m2 =
407--
407--
408-- Do not use at scale in concatMapWith.
408-- Do not use at scale in concatMapWith.
409--
409--
410−-- /Internal/
410+-- /Pre-release/
411{-# INLINE interleaveInfix #-}
411{-# INLINE interleaveInfix #-}
412interleaveInfix ::(IsStream t, Monad m) => t m b -> t m b -> t m b
412interleaveInfix ::(IsStream t, Monad m) => t m b -> t m b -> t m b
413interleaveInfix m1 m2 =
413interleaveInfix m1 m2 =
@@ -430,7 +430,7 @@ interleaveInfix m1 m2 =
430--
430--
431-- Do not use at scale in concatMapWith.
431-- Do not use at scale in concatMapWith.
432--
432--
433−-- /Internal/
433+-- /Pre-release/
434{-# INLINE interleaveMin #-}
434{-# INLINE interleaveMin #-}
435interleaveMin ::(IsStream t, Monad m) => t m b -> t m b -> t m b
435interleaveMin ::(IsStream t, Monad m) => t m b -> t m b -> t m b
436interleaveMin m1 m2 = fromStreamD $ D.interleaveMin (toStreamD m1) (toStreamD m2)
436interleaveMin m1 m2 = fromStreamD $ D.interleaveMin (toStreamD m1) (toStreamD m2)
@@ -450,7 +450,7 @@ interleaveMin m1 m2 = fromStreamD $ D.interleaveMin (toStreamD m1) (toStreamD m2
450--
450--
451-- Do not use at scale in concatMapWith.
451-- Do not use at scale in concatMapWith.
452--
452--
453−-- /Internal/
453+-- /Pre-release/
454{-# INLINE roundrobin #-}
454{-# INLINE roundrobin #-}
455roundrobin ::(IsStream t, Monad m) => t m b -> t m b -> t m b
455roundrobin ::(IsStream t, Monad m) => t m b -> t m b -> t m b
456roundrobin m1 m2 = fromStreamD $ D.roundRobin (toStreamD m1) (toStreamD m2)
456roundrobin m1 m2 = fromStreamD $ D.roundRobin (toStreamD m1) (toStreamD m2)
@@ -601,7 +601,7 @@ concatMapWith = K.concatMapBy
601-- concatSmapMWith combine f initial = concatMapWith combine id . smapM f initial
601-- concatSmapMWith combine f initial = concatMapWith combine id . smapM f initial
602-- @
602-- @
603--
603--
604−-- /Internal/
604+-- /Pre-release/
605--
605--
606{-# INLINE concatSmapMWith #-}
606{-# INLINE concatSmapMWith #-}
607concatSmapMWith
607concatSmapMWith
@@ -634,7 +634,7 @@ concatMap f m = fromStreamD $ D.concatMap (toStreamD . f) (toStreamD m)
634-- concat = concatMap id
634-- concat = concatMap id
635-- @
635-- @
636--
636--
637−-- /Internal/
637+-- /Pre-release/
638{-# INLINE concat #-}
638{-# INLINE concat #-}
639concat :: (IsStream t, Monad m) => t m (t m a) -> t m a
639concat :: (IsStream t, Monad m) => t m (t m a) -> t m a
640concat = concatMap id
640concat = concatMap id
@@ -669,7 +669,7 @@ concatMapEitherWith = undefined
669--
669--
670-- /Caution: the stream of streams must be finite/
670-- /Caution: the stream of streams must be finite/
671--
671--
672−-- /Internal/
672+-- /Pre-release/
673--
673--
674{-# INLINE concatPairsWith #-}
674{-# INLINE concatPairsWith #-}
675concatPairsWith :: IsStream t =>
675concatPairsWith :: IsStream t =>
@@ -695,7 +695,7 @@ concatUnfold u m = fromStreamD $ D.concatUnfold u (toStreamD m)
695-- | Like 'concatUnfold' but interleaves the streams in the same way as
695-- | Like 'concatUnfold' but interleaves the streams in the same way as
696-- 'interleave' behaves instead of appending them.
696-- 'interleave' behaves instead of appending them.
697--
697--
698−-- /Internal/
698+-- /Pre-release/
699{-# INLINE concatUnfoldInterleave #-}
699{-# INLINE concatUnfoldInterleave #-}
700concatUnfoldInterleave ::(IsStream t, Monad m)
700concatUnfoldInterleave ::(IsStream t, Monad m)
701 => Unfold m a b -> t m a -> t m b
701 => Unfold m a b -> t m a -> t m b
@@ -705,7 +705,7 @@ concatUnfoldInterleave u m =
705-- | Like 'concatUnfold' but executes the streams in the same way as
705-- | Like 'concatUnfold' but executes the streams in the same way as
706-- 'roundrobin'.
706-- 'roundrobin'.
707--
707--
708−-- /Internal/
708+-- /Pre-release/
709{-# INLINE concatUnfoldRoundrobin #-}
709{-# INLINE concatUnfoldRoundrobin #-}
710concatUnfoldRoundrobin ::(IsStream t, Monad m)
710concatUnfoldRoundrobin ::(IsStream t, Monad m)
711 => Unfold m a b -> t m a -> t m b
711 => Unfold m a b -> t m a -> t m b
@@ -723,7 +723,7 @@ concatUnfoldRoundrobin u m =
723--
723--
724-- > unwords = S.interpose ' '
724-- > unwords = S.interpose ' '
725--
725--
726−-- /Internal/
726+-- /Pre-release/
727{-# INLINE interpose #-}
727{-# INLINE interpose #-}
728interpose :: (IsStream t, Monad m)
728interpose :: (IsStream t, Monad m)
729 => c -> Unfold m b c -> t m b -> t m c
729 => c -> Unfold m b c -> t m b -> t m c
@@ -737,7 +737,7 @@ interpose x unf str =
737--
737--
738-- > unlines = S.interposeSuffix '\n'
738-- > unlines = S.interposeSuffix '\n'
739--
739--
740−-- /Internal/
740+-- /Pre-release/
741{-# INLINE interposeSuffix #-}
741{-# INLINE interposeSuffix #-}
742interposeSuffix :: (IsStream t, Monad m)
742interposeSuffix :: (IsStream t, Monad m)
743 => c -> Unfold m b c -> t m b -> t m c
743 => c -> Unfold m b c -> t m b -> t m c
@@ -758,7 +758,7 @@ interposeSuffix x unf str =
758--
758--
759-- | 'interleaveInfix' followed by unfold and concat.
759-- | 'interleaveInfix' followed by unfold and concat.
760--
760--
761−-- /Internal/
761+-- /Pre-release/
762{-# INLINE gintercalate #-}
762{-# INLINE gintercalate #-}
763gintercalate
763gintercalate
764 :: (IsStream t, Monad m)
764 :: (IsStream t, Monad m)
@@ -784,7 +784,7 @@ gintercalate unf1 str1 unf2 str2 =
784-- >>> Stream.toList $ Stream.intercalate " " Unfold.fromList $ Stream.fromList ["abc", "def", "ghi"]
784-- >>> Stream.toList $ Stream.intercalate " " Unfold.fromList $ Stream.fromList ["abc", "def", "ghi"]
785-- "abc def ghi"
785-- "abc def ghi"
786--
786--
787−-- /Internal/
787+-- /Pre-release/
788{-# INLINE intercalate #-}
788{-# INLINE intercalate #-}
789intercalate :: (IsStream t, Monad m)
789intercalate :: (IsStream t, Monad m)
790 => b -> Unfold m b c -> t m b -> t m c
790 => b -> Unfold m b c -> t m b -> t m c
@@ -793,7 +793,7 @@ intercalate seed unf str = D.fromStreamD $
793
793
794-- | 'interleaveSuffix' followed by unfold and concat.
794-- | 'interleaveSuffix' followed by unfold and concat.
795--
795--
796−-- /Internal/
796+-- /Pre-release/
797{-# INLINE gintercalateSuffix #-}
797{-# INLINE gintercalateSuffix #-}
798gintercalateSuffix
798gintercalateSuffix
799 :: (IsStream t, Monad m)
799 :: (IsStream t, Monad m)
@@ -813,7 +813,7 @@ gintercalateSuffix unf1 str1 unf2 str2 =
813-- >>> Stream.toList $ Stream.intercalateSuffix "\n" Unfold.fromList $ Stream.fromList ["abc", "def", "ghi"]
813-- >>> Stream.toList $ Stream.intercalateSuffix "\n" Unfold.fromList $ Stream.fromList ["abc", "def", "ghi"]
814-- "abc\ndef\nghi\n"
814-- "abc\ndef\nghi\n"
815--
815--
816−-- /Internal/
816+-- /Pre-release/
817{-# INLINE intercalateSuffix #-}
817{-# INLINE intercalateSuffix #-}
818intercalateSuffix :: (IsStream t, Monad m)
818intercalateSuffix :: (IsStream t, Monad m)
819 => b -> Unfold m b c -> t m b -> t m c
819 => b -> Unfold m b c -> t m b -> t m c
@@ -846,7 +846,7 @@ intercalateSuffix seed unf str = fromStreamD $ D.concatUnfold unf
846-- (yield (Left "tmp"))
846-- (yield (Left "tmp"))
847-- @
847-- @
848--
848--
849−-- /Internal/
849+-- /Pre-release/
850--
850--
851{-# INLINE iterateMapWith #-}
851{-# INLINE iterateMapWith #-}
852iterateMapWith
852iterateMapWith
@@ -883,7 +883,7 @@ iterateUnfold unf xs = undefined
883--
883--
884-- See also: 'mfix'
884-- See also: 'mfix'
885--
885--
886−-- /Internal/
886+-- /Pre-release/
887--
887--
888{-# INLINE iterateSmapMWith #-}
888{-# INLINE iterateSmapMWith #-}
889iterateSmapMWith
889iterateSmapMWith
@@ -922,7 +922,7 @@ iterateSmapMWith combine f initial stream =
922-- iterateMapLeftsWith serial Dir.toEither (yield (Left "tmp"))
922-- iterateMapLeftsWith serial Dir.toEither (yield (Left "tmp"))
923-- @
923-- @
924--
924--
925−-- /Internal/
925+-- /Pre-release/
926--
926--
927{-# INLINE iterateMapLeftsWith #-}
927{-# INLINE iterateMapLeftsWith #-}
928iterateMapLeftsWith
928iterateMapLeftsWith
@@ -954,7 +954,7 @@ iterateMapLeftsWith combine f = iterateMapWith combine (either f (const K.nil))
954-- >>> Stream.toList $ Stream.foldManyPost f $ Stream.fromList [1..10]
954-- >>> Stream.toList $ Stream.foldManyPost f $ Stream.fromList [1..10]
955-- [3,7,11,15,19,0]
955-- [3,7,11,15,19,0]
956--
956--
957−-- /Internal/
957+-- /Pre-release/
958--
958--
959{-# INLINE foldManyPost #-}
959{-# INLINE foldManyPost #-}
960foldManyPost
960foldManyPost
@@ -981,7 +981,7 @@ foldManyPost f m = D.fromStreamD $ D.foldManyPost f (D.toStreamD m)
981-- Note @foldMany (takeLE 0)@ would result in an infinite loop in a non-empty
981-- Note @foldMany (takeLE 0)@ would result in an infinite loop in a non-empty
982-- stream.
982-- stream.
983--
983--
984−-- /Internal/
984+-- /Pre-release/
985--
985--
986{-# INLINE foldMany #-}
986{-# INLINE foldMany #-}
987foldMany
987foldMany
@@ -994,7 +994,7 @@ foldMany f m = D.fromStreamD $ D.foldMany f (D.toStreamD m)
994-- | Apply a stream of folds to an input stream and emit the results in the
994-- | Apply a stream of folds to an input stream and emit the results in the
995-- output stream.
995-- output stream.
996--
996--
997−-- /Internal/
997+-- /Pre-release/
998--
998--
999{-# INLINE foldSequence #-}
999{-# INLINE foldSequence #-}
1000foldSequence
1000foldSequence
@@ -1020,7 +1020,7 @@ foldSequence _f _m = undefined
1020-- This is the streaming equivalent of monad like sequenced application of
1020-- This is the streaming equivalent of monad like sequenced application of
1021-- folds where next fold is dependent on the previous fold.
1021-- folds where next fold is dependent on the previous fold.
1022--
1022--
1023−-- /Internal/
1023+-- /Pre-release/
1024--
1024--
1025{-# INLINE foldIterate #-}
1025{-# INLINE foldIterate #-}
1026foldIterate
1026foldIterate
@@ -1058,7 +1058,7 @@ foldIterate _f _i _m = undefined
1058-- Known Issues: When the parser fails there is no way to get the remaining
1058-- Known Issues: When the parser fails there is no way to get the remaining
1059-- stream.
1059-- stream.
1060--
1060--
1061−-- /Internal/
1061+-- /Pre-release/
1062--
1062--
1063{-# INLINE parseMany #-}
1063{-# INLINE parseMany #-}
1064parseMany
1064parseMany
@@ -1081,7 +1081,7 @@ parseManyD p m =
1081-- | Apply a stream of parsers to an input stream and emit the results in the
1081-- | Apply a stream of parsers to an input stream and emit the results in the
1082-- output stream.
1082-- output stream.
1083--
1083--
1084−-- /Internal/
1084+-- /Pre-release/
1085--
1085--
1086{-# INLINE parseSequence #-}
1086{-# INLINE parseSequence #-}
1087parseSequence
1087parseSequence
@@ -1119,7 +1119,7 @@ parseManyTill = undefined
1119-- This is the streaming equivalent of monad like sequenced application of
1119-- This is the streaming equivalent of monad like sequenced application of
1120-- parsers where next parser is dependent on the previous parser.
1120-- parsers where next parser is dependent on the previous parser.
1121--
1121--
1122−-- /Internal/
1122+-- /Pre-release/
1123--
1123--
1124{-# INLINE parseIterate #-}
1124{-# INLINE parseIterate #-}
1125parseIterate
1125parseIterate
@@ -1591,7 +1591,7 @@ splitOnAny subseq f m = undefined -- D.fromStreamD $ D.splitOnAny f subseq (D.to
1591-- >>> splitOn'_ "ll" "hello"
1591-- >>> splitOn'_ "ll" "hello"
1592-- ["he","ll","o"]
1592-- ["he","ll","o"]
1593--
1593--
1594−-- /Internal/
1594+-- /Pre-release/
1595{-# INLINE splitBySeq #-}
1595{-# INLINE splitBySeq #-}
1596splitBySeq
1596splitBySeq
1597 :: (IsStream t, MonadAsync m, Storable a, Enum a, Eq a)
1597 :: (IsStream t, MonadAsync m, Storable a, Enum a, Eq a)
@@ -1640,7 +1640,7 @@ splitBySeq patt f m =
1640--
1640--
1641-- > splitSuffixOn . intercalateSuffix == id
1641-- > splitSuffixOn . intercalateSuffix == id
1642--
1642--
1643−-- /Internal/
1643+-- /Pre-release/
1644{-# INLINE splitOnSuffixSeq #-}
1644{-# INLINE splitOnSuffixSeq #-}
1645splitOnSuffixSeq
1645splitOnSuffixSeq
1646 :: (IsStream t, MonadIO m, Storable a, Enum a, Eq a)
1646 :: (IsStream t, MonadIO m, Storable a, Enum a, Eq a)
@@ -1686,7 +1686,7 @@ wordsOn subseq f m = undefined -- D.fromStreamD $ D.wordsOn f subseq (D.toStream
1686-- >>> splitWithSuffixSeq' "." "a..b.."
1686-- >>> splitWithSuffixSeq' "." "a..b.."
1687-- ["a.",".","b.","."]
1687-- ["a.",".","b.","."]
1688--
1688--
1689−-- /Internal/
1689+-- /Pre-release/
1690{-# INLINE splitWithSuffixSeq #-}
1690{-# INLINE splitWithSuffixSeq #-}
1691splitWithSuffixSeq
1691splitWithSuffixSeq
1692 :: (IsStream t, MonadIO m, Storable a, Enum a, Eq a)
1692 :: (IsStream t, MonadIO m, Storable a, Enum a, Eq a)
@@ -1729,7 +1729,7 @@ chunksOf n f = D.fromStreamD . D.chunksOf n f . D.toStreamD
1729
1729
1730-- |
1730-- |
1731--
1731--
1732−-- /Internal/
1732+-- /Pre-release/
1733{-# INLINE chunksOf2 #-}
1733{-# INLINE chunksOf2 #-}
1734chunksOf2
1734chunksOf2
1735 :: (IsStream t, Monad m)
1735 :: (IsStream t, Monad m)
@@ -1743,7 +1743,7 @@ chunksOf2 n action f m = D.fromStreamD $ D.groupsOf2 n action f (D.toStreamD m)
1743--
1743--
1744-- > arraysOf n = Stream.foldMany (A.writeN n)
1744-- > arraysOf n = Stream.foldMany (A.writeN n)
1745--
1745--
1746−-- /Internal/
1746+-- /Pre-release/
1747{-# INLINE arraysOf #-}
1747{-# INLINE arraysOf #-}
1748arraysOf :: (IsStream t, MonadIO m, Storable a)
1748arraysOf :: (IsStream t, MonadIO m, Storable a)
1749 => Int -> t m a -> t m (Array a)
1749 => Int -> t m a -> t m (Array a)
@@ -1929,7 +1929,7 @@ data SessionState t m k a b = SessionState
1929-- a new session. This could be useful to alert or eject sessions when the
1929-- a new session. This could be useful to alert or eject sessions when the
1930-- number of sessions becomes too high.
1930-- number of sessions becomes too high.
1931--
1931--
1932−-- /Internal/
1932+-- /Pre-release/
1933--
1933--
1934{-# INLINABLE classifySessionsBy #-}
1934{-# INLINABLE classifySessionsBy #-}
1935classifySessionsBy
1935classifySessionsBy
@@ -2163,7 +2163,7 @@ classifySessionsBy tick tmout reset ejectPred
2163-- classifyKeepAliveSessions timeout pred = classifySessionsBy 1 timeout True pred
2163-- classifyKeepAliveSessions timeout pred = classifySessionsBy 1 timeout True pred
2164-- @
2164-- @
2165--
2165--
2166−-- /Internal/
2166+-- /Pre-release/
2167--
2167--
2168{-# INLINABLE classifyKeepAliveSessions #-}
2168{-# INLINABLE classifyKeepAliveSessions #-}
2169classifyKeepAliveSessions ::
2169classifyKeepAliveSessions ::
@@ -2236,7 +2236,7 @@ classifyChunksOf wsize = classifyChunksBy wsize False
2236--
2236--
2237-- @
2237-- @
2238--
2238--
2239−-- /Internal/
2239+-- /Pre-release/
2240--
2240--
2241{-# INLINABLE classifySessionsOf #-}
2241{-# INLINABLE classifySessionsOf #-}
2242classifySessionsOf ::
2242classifySessionsOf ::
@@ -2265,7 +2265,7 @@ classifySessionsOf interval =
2265-- CAUTION! This is not a true streaming function as the container size after
2265-- CAUTION! This is not a true streaming function as the container size after
2266-- the split and merge may not be bounded.
2266-- the split and merge may not be bounded.
2267--
2267--
2268−-- /Internal/
2268+-- /Pre-release/
2269{-# INLINE splitInnerBy #-}
2269{-# INLINE splitInnerBy #-}
2270splitInnerBy
2270splitInnerBy
2271 :: (IsStream t, Monad m)
2271 :: (IsStream t, Monad m)
@@ -2279,7 +2279,7 @@ splitInnerBy splitter joiner xs =
2279-- | Like 'splitInnerBy' but splits assuming the separator joins the segment in
2279-- | Like 'splitInnerBy' but splits assuming the separator joins the segment in
2280-- a suffix style.
2280-- a suffix style.
2281--
2281--
2282−-- /Internal/
2282+-- /Pre-release/
2283{-# INLINE splitInnerBySuffix #-}
2283{-# INLINE splitInnerBySuffix #-}
2284splitInnerBySuffix
2284splitInnerBySuffix
2285 :: (IsStream t, Monad m, Eq (f a), Monoid (f a))
2285 :: (IsStream t, Monad m, Eq (f a), Monoid (f a))
src/Streamly/Internal/Data/Stream/IsStream/Top.hs+11−11
@@ -97,7 +97,7 @@ import Prelude hiding (filter, zipWith, concatMap, concat)
97-- >>> Stream.toList $ Stream.sampleFromThen 2 3 $ Stream.enumerateFromTo 0 10
97-- >>> Stream.toList $ Stream.sampleFromThen 2 3 $ Stream.enumerateFromTo 0 10
98-- [2,5,8]
98-- [2,5,8]
99--
99--
100−-- /Internal/
100+-- /Pre-release/
101--
101--
102{-# INLINE sampleFromThen #-}
102{-# INLINE sampleFromThen #-}
103sampleFromThen :: (IsStream t, Monad m, Functor (t m)) =>
103sampleFromThen :: (IsStream t, Monad m, Functor (t m)) =>
@@ -115,7 +115,7 @@ sampleFromThen offset stride =
115-- sampleIntervalEnd n = Stream.catMaybes . Stream.intervalsOf n Fold.last
115-- sampleIntervalEnd n = Stream.catMaybes . Stream.intervalsOf n Fold.last
116-- @
116-- @
117--
117--
118−-- /Internal/
118+-- /Pre-release/
119--
119--
120{-# INLINE sampleIntervalEnd #-}
120{-# INLINE sampleIntervalEnd #-}
121sampleIntervalEnd :: (IsStream t, MonadAsync m, Functor (t m)) =>
121sampleIntervalEnd :: (IsStream t, MonadAsync m, Functor (t m)) =>
@@ -128,7 +128,7 @@ sampleIntervalEnd n = Stream.catMaybes . Stream.intervalsOf n Fold.last
128-- sampleIntervalStart n = Stream.catMaybes . Stream.intervalsOf n Fold.head
128-- sampleIntervalStart n = Stream.catMaybes . Stream.intervalsOf n Fold.head
129-- @
129-- @
130--
130--
131−-- /Internal/
131+-- /Pre-release/
132--
132--
133{-# INLINE sampleIntervalStart #-}
133{-# INLINE sampleIntervalStart #-}
134sampleIntervalStart :: (IsStream t, MonadAsync m, Functor (t m)) =>
134sampleIntervalStart :: (IsStream t, MonadAsync m, Functor (t m)) =>
@@ -143,7 +143,7 @@ sampleIntervalStart n = Stream.catMaybes . Stream.intervalsOf n Fold.head
143--
143--
144-- The clock granularity is 10 ms.
144-- The clock granularity is 10 ms.
145--
145--
146−-- /Internal/
146+-- /Pre-release/
147--
147--
148{-# INLINE sampleBurstEnd #-}
148{-# INLINE sampleBurstEnd #-}
149sampleBurstEnd :: (IsStream t, MonadAsync m, Functor (t m)) =>
149sampleBurstEnd :: (IsStream t, MonadAsync m, Functor (t m)) =>
@@ -159,7 +159,7 @@ sampleBurstEnd gap =
159-- | Like 'sampleBurstEnd' but samples the event at the beginning of the burst
159-- | Like 'sampleBurstEnd' but samples the event at the beginning of the burst
160-- instead of at the end of it.
160-- instead of at the end of it.
161--
161--
162−-- /Internal/
162+-- /Pre-release/
163--
163--
164{-# INLINE sampleBurstStart #-}
164{-# INLINE sampleBurstStart #-}
165sampleBurstStart :: (IsStream t, MonadAsync m, Functor (t m)) =>
165sampleBurstStart :: (IsStream t, MonadAsync m, Functor (t m)) =>
@@ -186,7 +186,7 @@ sampleBurstStart gap =
186--
186--
187-- Note: this is not the fastest possible implementation as of now.
187-- Note: this is not the fastest possible implementation as of now.
188--
188--
189−-- /Internal/
189+-- /Pre-release/
190--
190--
191{-# INLINE sortBy #-}
191{-# INLINE sortBy #-}
192sortBy :: (IsStream t, Monad m) => (a -> a -> Ordering) -> t m a -> t m a
192sortBy :: (IsStream t, Monad m) => (a -> a -> Ordering) -> t m a -> t m a
@@ -231,7 +231,7 @@ sortBy f = Stream.concatPairsWith (Stream.mergeBy f) Stream.yield
231--
231--
232-- Time: O(m x n)
232-- Time: O(m x n)
233--
233--
234−-- /Internal/
234+-- /Pre-release/
235{-# INLINE crossJoin #-}
235{-# INLINE crossJoin #-}
236crossJoin :: Monad (t m) => t m a -> t m b -> t m (a, b)
236crossJoin :: Monad (t m) => t m a -> t m b -> t m (a, b)
237crossJoin s1 s2 = do
237crossJoin s1 s2 = do
@@ -259,7 +259,7 @@ crossJoin s1 s2 = do
259--
259--
260-- Time: O(m x n)
260-- Time: O(m x n)
261--
261--
262−-- /Internal/
262+-- /Pre-release/
263{-# INLINE innerJoin #-}
263{-# INLINE innerJoin #-}
264innerJoin ::
264innerJoin ::
265 forall (t :: (Type -> Type) -> Type -> Type) m a b.
265 forall (t :: (Type -> Type) -> Type -> Type) m a b.
@@ -487,7 +487,7 @@ mergeOuterJoin _eq _s1 _s2 = undefined
487-- Time: O(m x n) where @m@ is the number of elements in the first stream and
487-- Time: O(m x n) where @m@ is the number of elements in the first stream and
488-- @n@ is the number of elements in the second stream.
488-- @n@ is the number of elements in the second stream.
489--
489--
490−-- /Internal/
490+-- /Pre-release/
491{-# INLINE intersectBy #-}
491{-# INLINE intersectBy #-}
492intersectBy :: (IsStream t, Monad m) =>
492intersectBy :: (IsStream t, Monad m) =>
493 (a -> a -> Bool) -> t m a -> t m a -> t m a
493 (a -> a -> Bool) -> t m a -> t m a -> t m a
@@ -533,7 +533,7 @@ mergeIntersectBy _eq _s1 _s2 = undefined
533-- Time: O(m x n) where @m@ is the number of elements in the first stream and
533-- Time: O(m x n) where @m@ is the number of elements in the first stream and
534-- @n@ is the number of elements in the second stream.
534-- @n@ is the number of elements in the second stream.
535--
535--
536−-- /Internal/
536+-- /Pre-release/
537{-# INLINE differenceBy #-}
537{-# INLINE differenceBy #-}
538differenceBy :: (IsStream t, Monad m) =>
538differenceBy :: (IsStream t, Monad m) =>
539 (a -> a -> Bool) -> t m a -> t m a -> t m a
539 (a -> a -> Bool) -> t m a -> t m a -> t m a
@@ -577,7 +577,7 @@ mergeDifferenceBy _eq _s1 _s2 = undefined
577--
577--
578-- Time: O(m x n)
578-- Time: O(m x n)
579--
579--
580−-- /Internal/
580+-- /Pre-release/
581{-# INLINE unionBy #-}
581{-# INLINE unionBy #-}
582unionBy :: (IsStream t, MonadAsync m, Semigroup (t m a)) =>
582unionBy :: (IsStream t, MonadAsync m, Semigroup (t m a)) =>
583 (a -> a -> Bool) -> t m a -> t m a -> t m a
583 (a -> a -> Bool) -> t m a -> t m a -> t m a
src/Streamly/Internal/Data/Stream/IsStream/Transform.hs+31−31
@@ -275,7 +275,7 @@ import Prelude hiding
275
275
276-- | Use a 'Pipe' to transform a stream.
276-- | Use a 'Pipe' to transform a stream.
277--
277--
278−-- /Internal/
278+-- /Pre-release/
279--
279--
280{-# INLINE transform #-}
280{-# INLINE transform #-}
281transform :: (IsStream t, Monad m) => Pipe m a b -> t m a -> t m b
281transform :: (IsStream t, Monad m) => Pipe m a b -> t m a -> t m b
@@ -312,7 +312,7 @@ transform pipe xs = fromStreamD $ D.transform pipe (toStreamD xs)
312--
312--
313-- > foldrM f z s = runIdentityT $ foldrS (\x xs -> lift $ f x (runIdentityT xs)) (lift z) s
313-- > foldrM f z s = runIdentityT $ foldrS (\x xs -> lift $ f x (runIdentityT xs)) (lift z) s
314--
314--
315−-- /Internal/
315+-- /Pre-release/
316{-# INLINE foldrS #-}
316{-# INLINE foldrS #-}
317foldrS :: IsStream t => (a -> t m b -> t m b) -> t m b -> t m a -> t m b
317foldrS :: IsStream t => (a -> t m b -> t m b) -> t m b -> t m a -> t m b
318foldrS = K.foldrS
318foldrS = K.foldrS
@@ -327,7 +327,7 @@ foldrS = K.foldrS
327-- 'foldrT' can be used to translate streamly streams to other transformer
327-- 'foldrT' can be used to translate streamly streams to other transformer
328-- monads e.g. to a different streaming type.
328-- monads e.g. to a different streaming type.
329--
329--
330−-- /Internal/
330+-- /Pre-release/
331{-# INLINE foldrT #-}
331{-# INLINE foldrT #-}
332foldrT :: (IsStream t, Monad m, Monad (s m), MonadTrans s)
332foldrT :: (IsStream t, Monad m, Monad (s m), MonadTrans s)
333 => (a -> s m b -> s m b) -> s m b -> t m a -> s m b
333 => (a -> s m b -> s m b) -> s m b -> t m a -> s m b
@@ -431,7 +431,7 @@ tap f xs = D.fromStreamD $ D.tap f (D.toStreamD xs)
431-- [0,2,4,6,8,10]
431-- [0,2,4,6,8,10]
432
432
433--
433--
434−-- /Internal/
434+-- /Pre-release/
435--
435--
436{-# INLINE tapOffsetEvery #-}
436{-# INLINE tapOffsetEvery #-}
437tapOffsetEvery :: (IsStream t, Monad m)
437tapOffsetEvery :: (IsStream t, Monad m)
@@ -465,7 +465,7 @@ tapOffsetEvery offset n f xs =
465--
465--
466-- Compare with 'tap'.
466-- Compare with 'tap'.
467--
467--
468−-- /Internal/
468+-- /Pre-release/
469{-# INLINE tapAsync #-}
469{-# INLINE tapAsync #-}
470tapAsync :: (IsStream t, MonadAsync m) => FL.Fold m a b -> t m a -> t m a
470tapAsync :: (IsStream t, MonadAsync m) => FL.Fold m a b -> t m a -> t m a
471tapAsync f xs = D.fromStreamD $ Par.tapAsyncF f (D.toStreamD xs)
471tapAsync f xs = D.fromStreamD $ Par.tapAsyncF f (D.toStreamD xs)
@@ -485,7 +485,7 @@ tapAsync f xs = D.fromStreamD $ Par.tapAsyncF f (D.toStreamD xs)
485--
485--
486-- Note: This may not work correctly on 32-bit machines.
486-- Note: This may not work correctly on 32-bit machines.
487--
487--
488−-- /Internal/
488+-- /Pre-release/
489--
489--
490{-# INLINE pollCounts #-}
490{-# INLINE pollCounts #-}
491pollCounts ::
491pollCounts ::
@@ -516,7 +516,7 @@ pollCounts predicate transf f xs =
516--
516--
517-- Note: This may not work correctly on 32-bit machines.
517-- Note: This may not work correctly on 32-bit machines.
518--
518--
519−-- /Internal/
519+-- /Pre-release/
520{-# INLINE tapRate #-}
520{-# INLINE tapRate #-}
521tapRate ::
521tapRate ::
522 (IsStream t, MonadAsync m, MonadCatch m)
522 (IsStream t, MonadAsync m, MonadCatch m)
@@ -555,7 +555,7 @@ trace f = mapM (\x -> void (f x) >> return x)
555--
555--
556-- See also: 'trace'
556-- See also: 'trace'
557--
557--
558−-- /Internal/
558+-- /Pre-release/
559{-# INLINE trace_ #-}
559{-# INLINE trace_ #-}
560trace_ :: (IsStream t, Monad m) => m b -> t m a -> t m a
560trace_ :: (IsStream t, Monad m) => m b -> t m a -> t m a
561trace_ eff = Serial.mapM (\x -> eff >> return x)
561trace_ eff = Serial.mapM (\x -> eff >> return x)
@@ -688,7 +688,7 @@ postscanl' step z m = fromStreamD $ D.postscanl' step z $ toStreamD m
688--
688--
689-- | Like scanl' but does not stream the final value of the accumulator.
689-- | Like scanl' but does not stream the final value of the accumulator.
690--
690--
691−-- /Internal/
691+-- /Pre-release/
692{-# INLINE prescanl' #-}
692{-# INLINE prescanl' #-}
693prescanl' :: (IsStream t, Monad m) => (b -> a -> b) -> b -> t m a -> t m b
693prescanl' :: (IsStream t, Monad m) => (b -> a -> b) -> b -> t m a -> t m b
694prescanl' step z m = fromStreamD $ D.prescanl' step z $ toStreamD m
694prescanl' step z m = fromStreamD $ D.prescanl' step z $ toStreamD m
@@ -696,7 +696,7 @@ prescanl' step z m = fromStreamD $ D.prescanl' step z $ toStreamD m
696-- XXX this needs to be concurrent
696-- XXX this needs to be concurrent
697-- | Like prescanl' but with a monadic step function and a monadic seed.
697-- | Like prescanl' but with a monadic step function and a monadic seed.
698--
698--
699−-- /Internal/
699+-- /Pre-release/
700{-# INLINE prescanlM' #-}
700{-# INLINE prescanlM' #-}
701prescanlM' :: (IsStream t, Monad m) => (b -> a -> m b) -> m b -> t m a -> t m b
701prescanlM' :: (IsStream t, Monad m) => (b -> a -> m b) -> m b -> t m a -> t m b
702prescanlM' step z m = fromStreamD $ D.prescanlM' step z $ toStreamD m
702prescanlM' step z m = fromStreamD $ D.prescanlM' step z $ toStreamD m
@@ -737,7 +737,7 @@ scanl1' step m = fromStreamD $ D.scanl1' step $ toStreamD m
737-- filterWithRelTime = with timeIndexed filter
737-- filterWithRelTime = with timeIndexed filter
738-- @
738-- @
739--
739--
740−-- /Internal/
740+-- /Pre-release/
741{-# INLINE with #-}
741{-# INLINE with #-}
742with :: forall (t :: (Type -> Type) -> Type -> Type) m a b s. Functor (t m) =>
742with :: forall (t :: (Type -> Type) -> Type -> Type) m a b s. Functor (t m) =>
743 (t m a -> t m (s, a))
743 (t m a -> t m (s, a))
@@ -782,7 +782,7 @@ filterM p m = fromStreamD $ D.filterM p $ toStreamD m
782--
782--
783-- See also: 'nubBy'.
783-- See also: 'nubBy'.
784--
784--
785−-- /Internal/
785+-- /Pre-release/
786--
786--
787{-# INLINE uniqBy #-}
787{-# INLINE uniqBy #-}
788uniqBy :: (IsStream t, Monad m, Functor (t m)) =>
788uniqBy :: (IsStream t, Monad m, Functor (t m)) =>
@@ -988,7 +988,7 @@ takeWhileAround = undefined -- fromStreamD $ D.takeWhileAround n $ toStreamD m
988-- No element is yielded if the duration is zero. At least one element is
988-- No element is yielded if the duration is zero. At least one element is
989-- yielded if the duration is non-zero.
989-- yielded if the duration is non-zero.
990--
990--
991−-- /Internal/
991+-- /Pre-release/
992--
992--
993{-# INLINE takeByTime #-}
993{-# INLINE takeByTime #-}
994takeByTime ::(MonadIO m, IsStream t, TimeUnit64 d) => d -> t m a -> t m a
994takeByTime ::(MonadIO m, IsStream t, TimeUnit64 d) => d -> t m a -> t m a
@@ -1021,7 +1021,7 @@ dropWhileM p m = fromStreamD $ D.dropWhileM p $ toStreamD m
1021--
1021--
1022-- All elements are yielded if the duration is zero.
1022-- All elements are yielded if the duration is zero.
1023--
1023--
1024−-- /Internal/
1024+-- /Pre-release/
1025--
1025--
1026{-# INLINE dropByTime #-}
1026{-# INLINE dropByTime #-}
1027dropByTime ::(MonadIO m, IsStream t, TimeUnit64 d) => d -> t m a -> t m a
1027dropByTime ::(MonadIO m, IsStream t, TimeUnit64 d) => d -> t m a -> t m a
@@ -1106,7 +1106,7 @@ intersperse a = fromStreamS . S.intersperse a . toStreamS
1106-- >>> Stream.drain $ Stream.trace putChar $ Stream.intersperseM_ (putChar '.') $ Stream.fromList "hello"
1106-- >>> Stream.drain $ Stream.trace putChar $ Stream.intersperseM_ (putChar '.') $ Stream.fromList "hello"
1107-- h.e.l.l.o
1107-- h.e.l.l.o
1108--
1108--
1109−-- /Internal/
1109+-- /Pre-release/
1110{-# INLINE intersperseM_ #-}
1110{-# INLINE intersperseM_ #-}
1111intersperseM_ :: (IsStream t, Monad m) => m b -> t m a -> t m a
1111intersperseM_ :: (IsStream t, Monad m) => m b -> t m a -> t m a
1112intersperseM_ m = fromStreamD . D.intersperseM_ m . toStreamD
1112intersperseM_ m = fromStreamD . D.intersperseM_ m . toStreamD
@@ -1130,7 +1130,7 @@ intersperseBySpan _n _f _xs = undefined
1130-- >>> Stream.toList $ Stream.trace putChar $ intersperseSuffix (putChar '.' >> return ',') $ Stream.fromList "hello"
1130-- >>> Stream.toList $ Stream.trace putChar $ intersperseSuffix (putChar '.' >> return ',') $ Stream.fromList "hello"
1131-- h.,e.,l.,l.,o.,"h,e,l,l,o,"
1131-- h.,e.,l.,l.,o.,"h,e,l,l,o,"
1132--
1132--
1133−-- /Internal/
1133+-- /Pre-release/
1134{-# INLINE intersperseSuffix #-}
1134{-# INLINE intersperseSuffix #-}
1135intersperseSuffix :: (IsStream t, MonadAsync m) => m a -> t m a -> t m a
1135intersperseSuffix :: (IsStream t, MonadAsync m) => m a -> t m a -> t m a
1136intersperseSuffix m = fromStreamD . D.intersperseSuffix m . toStreamD
1136intersperseSuffix m = fromStreamD . D.intersperseSuffix m . toStreamD
@@ -1141,7 +1141,7 @@ intersperseSuffix m = fromStreamD . D.intersperseSuffix m . toStreamD
1141-- > S.mapM_ putChar $ S.intersperseSuffix_ (threadDelay 1000000) $ S.fromList "hello"
1141-- > S.mapM_ putChar $ S.intersperseSuffix_ (threadDelay 1000000) $ S.fromList "hello"
1142-- @
1142-- @
1143--
1143--
1144−-- /Internal/
1144+-- /Pre-release/
1145--
1145--
1146{-# INLINE intersperseSuffix_ #-}
1146{-# INLINE intersperseSuffix_ #-}
1147intersperseSuffix_ :: (IsStream t, Monad m) => m b -> t m a -> t m a
1147intersperseSuffix_ :: (IsStream t, Monad m) => m b -> t m a -> t m a
@@ -1155,7 +1155,7 @@ intersperseSuffix_ m = fromStreamD . D.intersperseSuffix_ m . toStreamD
1155-- >>> Stream.toList $ Stream.intersperseSuffixBySpan 2 (return ',') $ Stream.fromList "hello"
1155-- >>> Stream.toList $ Stream.intersperseSuffixBySpan 2 (return ',') $ Stream.fromList "hello"
1156-- "he,ll,o,"
1156-- "he,ll,o,"
1157--
1157--
1158−-- /Internal/
1158+-- /Pre-release/
1159--
1159--
1160{-# INLINE intersperseSuffixBySpan #-}
1160{-# INLINE intersperseSuffixBySpan #-}
1161intersperseSuffixBySpan :: (IsStream t, MonadAsync m)
1161intersperseSuffixBySpan :: (IsStream t, MonadAsync m)
@@ -1172,7 +1172,7 @@ intersperseSuffixBySpan n eff =
1172--
1172--
1173-- /Concurrent/
1173-- /Concurrent/
1174--
1174--
1175−-- /Internal/
1175+-- /Pre-release/
1176--
1176--
1177{-# INLINE interspersePrefix_ #-}
1177{-# INLINE interspersePrefix_ #-}
1178interspersePrefix_ :: (IsStream t, MonadAsync m) => m b -> t m a -> t m a
1178interspersePrefix_ :: (IsStream t, MonadAsync m) => m b -> t m a -> t m a
@@ -1192,7 +1192,7 @@ interspersePrefix_ m = mapM (\x -> void m >> return x)
1192-- (AbsTime (TimeSpec {sec = ..., nsec = ...}),2)
1192-- (AbsTime (TimeSpec {sec = ..., nsec = ...}),2)
1193-- (AbsTime (TimeSpec {sec = ..., nsec = ...}),3)
1193-- (AbsTime (TimeSpec {sec = ..., nsec = ...}),3)
1194--
1194--
1195−-- /Internal/
1195+-- /Pre-release/
1196--
1196--
1197{-# INLINE delay #-}
1197{-# INLINE delay #-}
1198delay :: (IsStream t, MonadIO m) => Double -> t m a -> t m a
1198delay :: (IsStream t, MonadIO m) => Double -> t m a -> t m a
@@ -1208,7 +1208,7 @@ delay n = intersperseM_ $ liftIO $ threadDelay $ round $ n * 1000000
1208-- (AbsTime (TimeSpec {sec = ..., nsec = ...}),2)
1208-- (AbsTime (TimeSpec {sec = ..., nsec = ...}),2)
1209-- (AbsTime (TimeSpec {sec = ..., nsec = ...}),3)
1209-- (AbsTime (TimeSpec {sec = ..., nsec = ...}),3)
1210--
1210--
1211−-- /Internal/
1211+-- /Pre-release/
1212--
1212--
1213{-# INLINE delayPost #-}
1213{-# INLINE delayPost #-}
1214delayPost :: (IsStream t, MonadIO m) => Double -> t m a -> t m a
1214delayPost :: (IsStream t, MonadIO m) => Double -> t m a -> t m a
@@ -1224,7 +1224,7 @@ delayPost n = intersperseSuffix_ $ liftIO $ threadDelay $ round $ n * 1000000
1224-- (AbsTime (TimeSpec {sec = ..., nsec = ...}),2)
1224-- (AbsTime (TimeSpec {sec = ..., nsec = ...}),2)
1225-- (AbsTime (TimeSpec {sec = ..., nsec = ...}),3)
1225-- (AbsTime (TimeSpec {sec = ..., nsec = ...}),3)
1226--
1226--
1227−-- /Internal/
1227+-- /Pre-release/
1228--
1228--
1229{-# INLINE delayPre #-}
1229{-# INLINE delayPre #-}
1230delayPre :: (IsStream t, MonadIO m) => Double -> t m a -> t m a
1230delayPre :: (IsStream t, MonadIO m) => Double -> t m a -> t m a
@@ -1302,7 +1302,7 @@ indexedR n = fromStreamD . D.indexedR n . toStreamD
1302-- (AbsTime (TimeSpec {sec = ..., nsec = ...}),2)
1302-- (AbsTime (TimeSpec {sec = ..., nsec = ...}),2)
1303-- (AbsTime (TimeSpec {sec = ..., nsec = ...}),3)
1303-- (AbsTime (TimeSpec {sec = ..., nsec = ...}),3)
1304--
1304--
1305−-- /Internal/
1305+-- /Pre-release/
1306--
1306--
1307{-# INLINE timestampWith #-}
1307{-# INLINE timestampWith #-}
1308timestampWith :: (IsStream t, MonadAsync m, Functor (t m))
1308timestampWith :: (IsStream t, MonadAsync m, Functor (t m))
@@ -1311,7 +1311,7 @@ timestampWith g stream = Z.zipWith (flip (,)) stream (absTimesWith g)
1311
1311
1312-- TBD: check performance vs a custom implementation without using zipWith.
1312-- TBD: check performance vs a custom implementation without using zipWith.
1313--
1313--
1314−-- /Internal/
1314+-- /Pre-release/
1315--
1315--
1316{-# INLINE timestamped #-}
1316{-# INLINE timestamped #-}
1317timestamped :: (IsStream t, MonadAsync m, Functor (t m))
1317timestamped :: (IsStream t, MonadAsync m, Functor (t m))
@@ -1327,7 +1327,7 @@ timestamped = timestampWith 0.01
1327-- (RelTime64 (NanoSecond64 ...),2)
1327-- (RelTime64 (NanoSecond64 ...),2)
1328-- (RelTime64 (NanoSecond64 ...),3)
1328-- (RelTime64 (NanoSecond64 ...),3)
1329--
1329--
1330−-- /Internal/
1330+-- /Pre-release/
1331--
1331--
1332{-# INLINE timeIndexWith #-}
1332{-# INLINE timeIndexWith #-}
1333timeIndexWith :: (IsStream t, MonadAsync m, Functor (t m))
1333timeIndexWith :: (IsStream t, MonadAsync m, Functor (t m))
@@ -1343,7 +1343,7 @@ timeIndexWith g stream = Z.zipWith (flip (,)) stream (relTimesWith g)
1343-- (RelTime64 (NanoSecond64 ...),2)
1343-- (RelTime64 (NanoSecond64 ...),2)
1344-- (RelTime64 (NanoSecond64 ...),3)
1344-- (RelTime64 (NanoSecond64 ...),3)
1345--
1345--
1346−-- /Internal/
1346+-- /Pre-release/
1347--
1347--
1348{-# INLINE timeIndexed #-}
1348{-# INLINE timeIndexed #-}
1349timeIndexed :: (IsStream t, MonadAsync m, Functor (t m))
1349timeIndexed :: (IsStream t, MonadAsync m, Functor (t m))
@@ -1376,7 +1376,7 @@ elemIndices a = findIndices (== a)
1376--
1376--
1377-- This is the stream equivalent of the list idiom @zipWith f xs (tail xs)@.
1377-- This is the stream equivalent of the list idiom @zipWith f xs (tail xs)@.
1378--
1378--
1379−-- /Internal/
1379+-- /Pre-release/
1380--
1380--
1381{-# INLINE rollingMap #-}
1381{-# INLINE rollingMap #-}
1382rollingMap :: (IsStream t, Monad m) => (a -> a -> b) -> t m a -> t m b
1382rollingMap :: (IsStream t, Monad m) => (a -> a -> b) -> t m a -> t m b
@@ -1384,7 +1384,7 @@ rollingMap f m = fromStreamD $ D.rollingMap f $ toStreamD m
1384
1384
1385-- | Like 'rollingMap' but with an effectful map function.
1385-- | Like 'rollingMap' but with an effectful map function.
1386--
1386--
1387−-- /Internal/
1387+-- /Pre-release/
1388--
1388--
1389{-# INLINE rollingMapM #-}
1389{-# INLINE rollingMapM #-}
1390rollingMapM :: (IsStream t, Monad m) => (a -> a -> m b) -> t m a -> t m b
1390rollingMapM :: (IsStream t, Monad m) => (a -> a -> m b) -> t m a -> t m b
@@ -1431,7 +1431,7 @@ mapMaybeMSerial f m = fromStreamD $ D.mapMaybeM f $ toStreamD m
1431
1431
1432-- | In a stream of 'Maybe's, discard 'Nothing's and unwrap 'Just's.
1432-- | In a stream of 'Maybe's, discard 'Nothing's and unwrap 'Just's.
1433--
1433--
1434−-- /Internal/
1434+-- /Pre-release/
1435--
1435--
1436catMaybes :: (IsStream t, Monad m, Functor (t m)) => t m (Maybe a) -> t m a
1436catMaybes :: (IsStream t, Monad m, Functor (t m)) => t m (Maybe a) -> t m a
1437catMaybes = fmap fromJust . filter isJust
1437catMaybes = fmap fromJust . filter isJust
@@ -1442,14 +1442,14 @@ catMaybes = fmap fromJust . filter isJust
1442
1442
1443-- | Discard 'Right's and unwrap 'Left's in an 'Either' stream.
1443-- | Discard 'Right's and unwrap 'Left's in an 'Either' stream.
1444--
1444--
1445−-- /Internal/
1445+-- /Pre-release/
1446--
1446--
1447lefts :: (IsStream t, Monad m, Functor (t m)) => t m (Either a b) -> t m a
1447lefts :: (IsStream t, Monad m, Functor (t m)) => t m (Either a b) -> t m a
1448lefts = fmap (fromLeft undefined) . filter isLeft
1448lefts = fmap (fromLeft undefined) . filter isLeft
1449
1449
1450-- | Discard 'Left's and unwrap 'Right's in an 'Either' stream.
1450-- | Discard 'Left's and unwrap 'Right's in an 'Either' stream.
1451--
1451--
1452−-- /Internal/
1452+-- /Pre-release/
1453--
1453--
1454rights :: (IsStream t, Monad m, Functor (t m)) => t m (Either a b) -> t m b
1454rights :: (IsStream t, Monad m, Functor (t m)) => t m (Either a b) -> t m b
1455rights = fmap (fromRight undefined) . filter isRight
1455rights = fmap (fromRight undefined) . filter isRight
src/Streamly/Internal/Data/Stream/Parallel.hs+7−7
@@ -278,7 +278,7 @@ parallel = joinStreamVarPar ParallelVar StopNone
278--
278--
279-- | Like `parallel` but stops the output as soon as the first stream stops.
279-- | Like `parallel` but stops the output as soon as the first stream stops.
280--
280--
281−-- /Internal/
281+-- /Pre-release/
282{-# INLINE parallelFst #-}
282{-# INLINE parallelFst #-}
283parallelFst :: (IsStream t, MonadAsync m) => t m a -> t m a -> t m a
283parallelFst :: (IsStream t, MonadAsync m) => t m a -> t m a -> t m a
284parallelFst = joinStreamVarPar ParallelVar StopBy
284parallelFst = joinStreamVarPar ParallelVar StopBy
@@ -288,7 +288,7 @@ parallelFst = joinStreamVarPar ParallelVar StopBy
288-- | Like `parallel` but stops the output as soon as any of the two streams
288-- | Like `parallel` but stops the output as soon as any of the two streams
289-- stops.
289-- stops.
290--
290--
291−-- /Internal/
291+-- /Pre-release/
292{-# INLINE parallelMin #-}
292{-# INLINE parallelMin #-}
293parallelMin :: (IsStream t, MonadAsync m) => t m a -> t m a -> t m a
293parallelMin :: (IsStream t, MonadAsync m) => t m a -> t m a -> t m a
294parallelMin = joinStreamVarPar ParallelVar StopAny
294parallelMin = joinStreamVarPar ParallelVar StopAny
@@ -299,7 +299,7 @@ parallelMin = joinStreamVarPar ParallelVar StopAny
299
299
300-- | Like 'mkParallel' but uses StreamK internally.
300-- | Like 'mkParallel' but uses StreamK internally.
301--
301--
302−-- /Internal/
302+-- /Pre-release/
303--
303--
304mkParallelK :: (IsStream t, MonadAsync m) => t m a -> t m a
304mkParallelK :: (IsStream t, MonadAsync m) => t m a -> t m a
305mkParallelK m = mkStream $ \st yld sng stp -> do
305mkParallelK m = mkStream $ \st yld sng stp -> do
@@ -345,7 +345,7 @@ mkParallelD m = D.Stream step Nothing
345--
345--
346-- @mkParallel = D.fromStreamD . mkParallelD . D.toStreamD@
346-- @mkParallel = D.fromStreamD . mkParallelD . D.toStreamD@
347--
347--
348−-- /Internal/
348+-- /Pre-release/
349--
349--
350{-# INLINE_NORMAL mkParallel #-}
350{-# INLINE_NORMAL mkParallel #-}
351mkParallel :: (K.IsStream t, MonadAsync m) => t m a -> t m a
351mkParallel :: (K.IsStream t, MonadAsync m) => t m a -> t m a
@@ -395,7 +395,7 @@ mkParallel = D.fromStreamD . mkParallelD . D.toStreamD
395--
395--
396-- Compare with 'tap'.
396-- Compare with 'tap'.
397--
397--
398−-- /Internal/
398+-- /Pre-release/
399{-# INLINE tapAsync #-}
399{-# INLINE tapAsync #-}
400tapAsync :: (IsStream t, MonadAsync m) => (t m a -> m b) -> t m a -> t m a
400tapAsync :: (IsStream t, MonadAsync m) => (t m a -> m b) -> t m a -> t m a
401tapAsync f m = mkStream $ \st yld sng stp -> do
401tapAsync f m = mkStream $ \st yld sng stp -> do
@@ -470,7 +470,7 @@ tapAsyncF f (D.Stream step1 state1) = D.Stream step TapInit
470-- distributeAsync_ = flip (foldr tapAsync)
470-- distributeAsync_ = flip (foldr tapAsync)
471-- @
471-- @
472--
472--
473−-- /Internal/
473+-- /Pre-release/
474--
474--
475{-# INLINE distributeAsync_ #-}
475{-# INLINE distributeAsync_ #-}
476distributeAsync_ :: (Foldable f, IsStream t, MonadAsync m)
476distributeAsync_ :: (Foldable f, IsStream t, MonadAsync m)
@@ -648,7 +648,7 @@ MONAD_COMMON_INSTANCES(ParallelT, MONADPARALLEL)
648-- queue values to the stream. The stream is infinite, there is no way for the
648-- queue values to the stream. The stream is infinite, there is no way for the
649-- callback to indicate that it is done now.
649-- callback to indicate that it is done now.
650--
650--
651−-- /Internal/
651+-- /Pre-release/
652--
652--
653{-# INLINE_NORMAL newCallbackStream #-}
653{-# INLINE_NORMAL newCallbackStream #-}
654newCallbackStream :: (K.IsStream t, MonadAsync m) => m (a -> m (), t m a)
654newCallbackStream :: (K.IsStream t, MonadAsync m) => m (a -> m (), t m a)
src/Streamly/Internal/Data/Stream/Serial.hs+1−1
@@ -504,7 +504,7 @@ TRAVERSABLE_INSTANCE(WSerialT)
504-- 3
504-- 3
505-- @
505-- @
506--
506--
507−-- /Internal/
507+-- /Pre-release/
508--
508--
509{-# INLINE unfoldrM #-}
509{-# INLINE unfoldrM #-}
510unfoldrM :: (IsStream t, Monad m) => (b -> m (Maybe (a, b))) -> b -> t m a
510unfoldrM :: (IsStream t, Monad m) => (b -> m (Maybe (a, b))) -> b -> t m a
src/Streamly/Internal/Data/Stream/StreamD/Exception.hs+2−2
@@ -51,7 +51,7 @@ data GbracketState s1 s2 v
51--
51--
52-- /Inhibits stream fusion/
52-- /Inhibits stream fusion/
53--
53--
54−-- /Internal/
54+-- /Pre-release/
55--
55--
56{-# INLINE_NORMAL gbracket_ #-}
56{-# INLINE_NORMAL gbracket_ #-}
57gbracket_
57gbracket_
@@ -110,7 +110,7 @@ data GbracketIOState s1 s2 v wref
110--
110--
111-- /Inhibits stream fusion/
111-- /Inhibits stream fusion/
112--
112--
113−-- /Internal/
113+-- /Pre-release/
114{-# INLINE_NORMAL gbracket #-}
114{-# INLINE_NORMAL gbracket #-}
115gbracket
115gbracket
116 :: (MonadIO m, MonadBaseControl IO m)
116 :: (MonadIO m, MonadBaseControl IO m)
src/Streamly/Internal/Data/Stream/StreamK.hs+3−3
@@ -277,14 +277,14 @@ once = yieldM
277--
277--
278-- Generate an infinite stream by repeating a monadic value.
278-- Generate an infinite stream by repeating a monadic value.
279--
279--
280−-- /Internal/
280+-- /Pre-release/
281repeatM :: (IsStream t, MonadAsync m) => m a -> t m a
281repeatM :: (IsStream t, MonadAsync m) => m a -> t m a
282repeatM = go
282repeatM = go
283 where go m = m |: go m
283 where go m = m |: go m
284
284
285-- Generate an infinite stream by repeating a pure value.
285-- Generate an infinite stream by repeating a pure value.
286--
286--
287−-- /Internal/
287+-- /Pre-release/
288{-# INLINE repeat #-}
288{-# INLINE repeat #-}
289repeat :: IsStream t => a -> t m a
289repeat :: IsStream t => a -> t m a
290repeat a = let x = cons a x in x
290repeat a = let x = cons a x in x
@@ -568,7 +568,7 @@ tailPartial m = mkStream $ \st yld sng stp ->
568-- Note that the function @f@ must be lazy in its argument, that's why we use
568-- Note that the function @f@ must be lazy in its argument, that's why we use
569-- 'unsafeInterleaveIO' on @action@ because IO monad is strict.
569-- 'unsafeInterleaveIO' on @action@ because IO monad is strict.
570--
570--
571−-- /Internal/
571+-- /Pre-release/
572
572
573mfix :: (IsStream t, Monad m) => (m a -> t m a) -> t m a
573mfix :: (IsStream t, Monad m) => (m a -> t m a) -> t m a
574mfix f = mkStream $ \st yld sng stp ->
574mfix f = mkStream $ \st yld sng stp ->
src/Streamly/Internal/Data/Stream/StreamK/Type.hs+1−1
@@ -340,7 +340,7 @@ nil = mkStream $ \_ _ _ stp -> stp
340-- []
340-- []
341-- @
341-- @
342--
342--
343−-- /Internal/
343+-- /Pre-release/
344{-# INLINE_NORMAL nilM #-}
344{-# INLINE_NORMAL nilM #-}
345nilM :: (IsStream t, Monad m) => m b -> t m a
345nilM :: (IsStream t, Monad m) => m b -> t m a
346nilM m = mkStream $ \_ _ _ stp -> m >> stp
346nilM m = mkStream $ \_ _ _ stp -> m >> stp
src/Streamly/Internal/Data/Unfold.hs+32−32
@@ -209,7 +209,7 @@ import Prelude
209-- lmapM f = concat (singletonM f)
209-- lmapM f = concat (singletonM f)
210-- @
210-- @
211--
211--
212−-- /Internal/
212+-- /Pre-release/
213{-# INLINE_NORMAL lmapM #-}
213{-# INLINE_NORMAL lmapM #-}
214lmapM :: Monad m => (a -> m c) -> Unfold m c b -> Unfold m a b
214lmapM :: Monad m => (a -> m c) -> Unfold m c b -> Unfold m a b
215lmapM f (Unfold ustep uinject) = Unfold ustep (f >=> uinject)
215lmapM f (Unfold ustep uinject) = Unfold ustep (f >=> uinject)
@@ -219,7 +219,7 @@ lmapM f (Unfold ustep uinject) = Unfold ustep (f >=> uinject)
219--
219--
220-- | Supply the seed to an unfold closing the input end of the unfold.
220-- | Supply the seed to an unfold closing the input end of the unfold.
221--
221--
222−-- /Internal/
222+-- /Pre-release/
223--
223--
224{-# INLINE_NORMAL supply #-}
224{-# INLINE_NORMAL supply #-}
225supply :: Unfold m a b -> a -> Unfold m Void b
225supply :: Unfold m a b -> a -> Unfold m Void b
@@ -232,7 +232,7 @@ supply unf a = lmap (Prelude.const a) unf
232-- as a seed resulting in a fold that accepts the second component of the tuple
232-- as a seed resulting in a fold that accepts the second component of the tuple
233-- as a seed.
233-- as a seed.
234--
234--
235−-- /Internal/
235+-- /Pre-release/
236--
236--
237{-# INLINE_NORMAL supplyFirst #-}
237{-# INLINE_NORMAL supplyFirst #-}
238supplyFirst :: Unfold m (a, b) c -> a -> Unfold m b c
238supplyFirst :: Unfold m (a, b) c -> a -> Unfold m b c
@@ -245,7 +245,7 @@ supplyFirst unf a = lmap (a, ) unf
245-- as a seed resulting in a fold that accepts the first component of the tuple
245-- as a seed resulting in a fold that accepts the first component of the tuple
246-- as a seed.
246-- as a seed.
247--
247--
248−-- /Internal/
248+-- /Pre-release/
249--
249--
250{-# INLINE_NORMAL supplySecond #-}
250{-# INLINE_NORMAL supplySecond #-}
251supplySecond :: Unfold m (a, b) c -> b -> Unfold m a c
251supplySecond :: Unfold m (a, b) c -> b -> Unfold m a c
@@ -255,7 +255,7 @@ supplySecond unf b = lmap (, b) unf
255-- using the argument of the original fold as the second element of tuple and
255-- using the argument of the original fold as the second element of tuple and
256-- discarding the first element of the tuple.
256-- discarding the first element of the tuple.
257--
257--
258−-- /Internal/
258+-- /Pre-release/
259--
259--
260{-# INLINE_NORMAL discardFirst #-}
260{-# INLINE_NORMAL discardFirst #-}
261discardFirst :: Unfold m a b -> Unfold m (c, a) b
261discardFirst :: Unfold m a b -> Unfold m (c, a) b
@@ -265,7 +265,7 @@ discardFirst = lmap snd
265-- using the argument of the original fold as the first element of tuple and
265-- using the argument of the original fold as the first element of tuple and
266-- discarding the second element of the tuple.
266-- discarding the second element of the tuple.
267--
267--
268−-- /Internal/
268+-- /Pre-release/
269--
269--
270{-# INLINE_NORMAL discardSecond #-}
270{-# INLINE_NORMAL discardSecond #-}
271discardSecond :: Unfold m a b -> Unfold m (a, c) b
271discardSecond :: Unfold m a b -> Unfold m (a, c) b
@@ -274,7 +274,7 @@ discardSecond = lmap fst
274-- | Convert an 'Unfold' that accepts a tuple as an argument into an unfold
274-- | Convert an 'Unfold' that accepts a tuple as an argument into an unfold
275-- that accepts a tuple with elements swapped.
275-- that accepts a tuple with elements swapped.
276--
276--
277−-- /Internal/
277+-- /Pre-release/
278--
278--
279{-# INLINE_NORMAL swap #-}
279{-# INLINE_NORMAL swap #-}
280swap :: Unfold m (a, c) b -> Unfold m (c, a) b
280swap :: Unfold m (a, c) b -> Unfold m (c, a) b
@@ -288,7 +288,7 @@ swap = lmap Tuple.swap
288-- @Fold m b c@, returns a monadic action @a -> m c@ representing the
288-- @Fold m b c@, returns a monadic action @a -> m c@ representing the
289-- application of the fold on the unfolded stream.
289-- application of the fold on the unfolded stream.
290--
290--
291−-- /Internal/
291+-- /Pre-release/
292--
292--
293{-# INLINE_NORMAL fold #-}
293{-# INLINE_NORMAL fold #-}
294fold :: Monad m => Unfold m a b -> Fold m b c -> a -> m c
294fold :: Monad m => Unfold m a b -> Fold m b c -> a -> m c
@@ -374,7 +374,7 @@ fromStreamK = Unfold step return
374-- | Convert a stream into an 'Unfold'. Note that a stream converted to an
374-- | Convert a stream into an 'Unfold'. Note that a stream converted to an
375-- 'Unfold' may not be as efficient as an 'Unfold' in some situations.
375-- 'Unfold' may not be as efficient as an 'Unfold' in some situations.
376--
376--
377−-- /Internal/
377+-- /Pre-release/
378{-# INLINE_NORMAL fromStream #-}
378{-# INLINE_NORMAL fromStream #-}
379fromStream :: (K.IsStream t, Monad m) => Unfold m (t m a) a
379fromStream :: (K.IsStream t, Monad m) => Unfold m (t m a) a
380fromStream = lmap K.toStream fromStreamK
380fromStream = lmap K.toStream fromStreamK
@@ -395,7 +395,7 @@ nilM f = Unfold step return
395
395
396-- | Prepend a monadic single element generator function to an 'Unfold'.
396-- | Prepend a monadic single element generator function to an 'Unfold'.
397--
397--
398−-- /Internal/
398+-- /Pre-release/
399{-# INLINE_NORMAL consM #-}
399{-# INLINE_NORMAL consM #-}
400consM :: Monad m => (a -> m b) -> Unfold m a b -> Unfold m a b
400consM :: Monad m => (a -> m b) -> Unfold m a b -> Unfold m a b
401consM action unf = Unfold step inject
401consM action unf = Unfold step inject
@@ -449,7 +449,7 @@ fromListM = Unfold step inject
449-- The step function returns the next element in the stream and the next seed
449-- The step function returns the next element in the stream and the next seed
450-- value. When it is done it returns 'Nothing' and the stream ends.
450-- value. When it is done it returns 'Nothing' and the stream ends.
451--
451--
452−-- /Internal/
452+-- /Pre-release/
453--
453--
454{-# INLINE unfoldrM #-}
454{-# INLINE unfoldrM #-}
455unfoldrM :: Monad m => (a -> m (Maybe (b, a))) -> Unfold m a b
455unfoldrM :: Monad m => (a -> m (Maybe (b, a))) -> Unfold m a b
@@ -468,7 +468,7 @@ unfoldrM next = Unfold step return
468
468
469-- | Generates a stream replicating the seed @n@ times.
469-- | Generates a stream replicating the seed @n@ times.
470--
470--
471−-- /Internal/
471+-- /Pre-release/
472--
472--
473{-# INLINE replicateM #-}
473{-# INLINE replicateM #-}
474replicateM :: Monad m => Int -> Unfold m (m a) a
474replicateM :: Monad m => Int -> Unfold m (m a) a
@@ -488,7 +488,7 @@ replicateM n = Unfold step inject
488
488
489-- | Generates an infinite stream repeating the seed.
489-- | Generates an infinite stream repeating the seed.
490--
490--
491−-- /Internal/
491+-- /Pre-release/
492--
492--
493{-# INLINE repeatM #-}
493{-# INLINE repeatM #-}
494repeatM :: Monad m => Unfold m (m a) a
494repeatM :: Monad m => Unfold m (m a) a
@@ -500,7 +500,7 @@ repeatM = Unfold step return
500-- | Generates an infinite stream starting with the given seed and applying the
500-- | Generates an infinite stream starting with the given seed and applying the
501-- given function repeatedly.
501-- given function repeatedly.
502--
502--
503−-- /Internal/
503+-- /Pre-release/
504--
504--
505{-# INLINE iterateM #-}
505{-# INLINE iterateM #-}
506iterateM :: Monad m => (a -> m a) -> Unfold m (m a) a
506iterateM :: Monad m => (a -> m a) -> Unfold m (m a) a
@@ -514,7 +514,7 @@ iterateM f = Unfold step id
514-- | @fromIndicesM gen@ generates an infinite stream of values using @gen@
514-- | @fromIndicesM gen@ generates an infinite stream of values using @gen@
515-- starting from the seed.
515-- starting from the seed.
516--
516--
517−-- /Internal/
517+-- /Pre-release/
518--
518--
519{-# INLINE_NORMAL fromIndicesM #-}
519{-# INLINE_NORMAL fromIndicesM #-}
520fromIndicesM :: Monad m => (Int -> m a) -> Unfold m Int a
520fromIndicesM :: Monad m => (Int -> m a) -> Unfold m Int a
@@ -583,7 +583,7 @@ filter f = filterM (return . f)
583
583
584-- | @drop n unf@ drops @n@ elements from the stream generated by @unf@.
584-- | @drop n unf@ drops @n@ elements from the stream generated by @unf@.
585--
585--
586−-- /Internal/
586+-- /Pre-release/
587--
587--
588{-# INLINE_NORMAL drop #-}
588{-# INLINE_NORMAL drop #-}
589drop :: Monad m => Int -> Unfold m a b -> Unfold m a b
589drop :: Monad m => Int -> Unfold m a b -> Unfold m a b
@@ -615,7 +615,7 @@ drop n (Unfold step inject) = Unfold step' inject'
615-- | @dropWhileM f unf@ drops elements from the stream generated by @unf@ while
615-- | @dropWhileM f unf@ drops elements from the stream generated by @unf@ while
616-- the condition holds true. The condition function @f@ is /monadic/ in nature.
616-- the condition holds true. The condition function @f@ is /monadic/ in nature.
617--
617--
618−-- /Internal/
618+-- /Pre-release/
619--
619--
620{-# INLINE_NORMAL dropWhileM #-}
620{-# INLINE_NORMAL dropWhileM #-}
621dropWhileM :: Monad m => (b -> m Bool) -> Unfold m a b -> Unfold m a b
621dropWhileM :: Monad m => (b -> m Bool) -> Unfold m a b -> Unfold m a b
@@ -649,7 +649,7 @@ dropWhileM f (Unfold step inject) = Unfold step' inject'
649
649
650-- | Similar to 'dropWhileM' but with a pure condition function.
650-- | Similar to 'dropWhileM' but with a pure condition function.
651--
651--
652−-- /Internal/
652+-- /Pre-release/
653--
653--
654{-# INLINE dropWhile #-}
654{-# INLINE dropWhile #-}
655dropWhile :: Monad m => (b -> Bool) -> Unfold m a b -> Unfold m a b
655dropWhile :: Monad m => (b -> Bool) -> Unfold m a b -> Unfold m a b
@@ -683,7 +683,7 @@ enumerateFromIntegral = enumerateFromToIntegral maxBound
683-- | Generate an infinite stream starting from the seed with increments of the
683-- | Generate an infinite stream starting from the seed with increments of the
684-- given stride.
684-- given stride.
685--
685--
686−-- /Internal/
686+-- /Pre-release/
687--
687--
688{-# INLINE enumerateFromStepNum #-}
688{-# INLINE enumerateFromStepNum #-}
689enumerateFromStepNum :: (Monad m, Num a) => a -> Unfold m a a
689enumerateFromStepNum :: (Monad m, Num a) => a -> Unfold m a a
@@ -694,7 +694,7 @@ enumerateFromStepNum stride = Unfold step return
694
694
695-- | @numFrom = enumerateFromStepNum 1@
695-- | @numFrom = enumerateFromStepNum 1@
696--
696--
697−-- /Internal/
697+-- /Pre-release/
698--
698--
699{-# INLINE_NORMAL numFrom #-}
699{-# INLINE_NORMAL numFrom #-}
700numFrom :: (Monad m, Num a) => Unfold m a a
700numFrom :: (Monad m, Num a) => Unfold m a a
@@ -847,7 +847,7 @@ fromProducer = Unfold step (return . FromSVarRead)
847-- S.mapM_ print $ S.concatUnfold (UF.teeZipWith (,) UF.identity (UF.singleton sqrt)) $ S.fromList [1..10]
847-- S.mapM_ print $ S.concatUnfold (UF.teeZipWith (,) UF.identity (UF.singleton sqrt)) $ S.fromList [1..10]
848-- @
848-- @
849--
849--
850−-- /Internal/
850+-- /Pre-release/
851--
851--
852{-# INLINE_NORMAL teeZipWith #-}
852{-# INLINE_NORMAL teeZipWith #-}
853teeZipWith :: Monad m
853teeZipWith :: Monad m
@@ -905,7 +905,7 @@ outerProduct (Unfold step1 inject1) (Unfold step2 inject2) = Unfold step inject
905--
905--
906-- /Inhibits stream fusion/
906-- /Inhibits stream fusion/
907--
907--
908−-- /Internal/
908+-- /Pre-release/
909--
909--
910{-# INLINE_NORMAL gbracket_ #-}
910{-# INLINE_NORMAL gbracket_ #-}
911gbracket_
911gbracket_
@@ -960,7 +960,7 @@ gbracket_ bef exc aft (Unfold estep einject) (Unfold step1 inject1) =
960--
960--
961-- /Inhibits stream fusion/
961-- /Inhibits stream fusion/
962--
962--
963−-- /Internal/
963+-- /Pre-release/
964{-# INLINE_NORMAL gbracket #-}
964{-# INLINE_NORMAL gbracket #-}
965gbracket
965gbracket
966 :: (MonadIO m, MonadBaseControl IO m)
966 :: (MonadIO m, MonadBaseControl IO m)
@@ -1022,7 +1022,7 @@ _before action = gbracket_ (\x -> action x >> return x) (fmap Right)
1022-- | Run a side effect @a -> m c@ on the input @a@ before unfolding it using
1022-- | Run a side effect @a -> m c@ on the input @a@ before unfolding it using
1023-- @Unfold m a b@.
1023-- @Unfold m a b@.
1024--
1024--
1025−-- /Internal/
1025+-- /Pre-release/
1026{-# INLINE_NORMAL before #-}
1026{-# INLINE_NORMAL before #-}
1027before :: Monad m => (a -> m c) -> Unfold m a b -> Unfold m a b
1027before :: Monad m => (a -> m c) -> Unfold m a b -> Unfold m a b
1028before action (Unfold step1 inject1) = Unfold step inject
1028before action (Unfold step1 inject1) = Unfold step inject
@@ -1051,7 +1051,7 @@ _after aft = gbracket_ return (fmap Right) aft undefined
1051-- after partial evaluation.
1051-- after partial evaluation.
1052-- * Monad @m@ does not require any other constraints.
1052-- * Monad @m@ does not require any other constraints.
1053--
1053--
1054−-- /Internal/
1054+-- /Pre-release/
1055{-# INLINE_NORMAL after_ #-}
1055{-# INLINE_NORMAL after_ #-}
1056after_ :: Monad m => (a -> m c) -> Unfold m a b -> Unfold m a b
1056after_ :: Monad m => (a -> m c) -> Unfold m a b -> Unfold m a b
1057after_ action (Unfold step1 inject1) = Unfold step inject
1057after_ action (Unfold step1 inject1) = Unfold step inject
@@ -1079,7 +1079,7 @@ after_ action (Unfold step1 inject1) = Unfold step inject
1079--
1079--
1080-- /See also 'after_'/
1080-- /See also 'after_'/
1081--
1081--
1082−-- /Internal/
1082+-- /Pre-release/
1083{-# INLINE_NORMAL after #-}
1083{-# INLINE_NORMAL after #-}
1084after :: (MonadIO m, MonadBaseControl IO m)
1084after :: (MonadIO m, MonadBaseControl IO m)
1085 => (a -> m c) -> Unfold m a b -> Unfold m a b
1085 => (a -> m c) -> Unfold m a b -> Unfold m a b
@@ -1114,7 +1114,7 @@ _onException action =
1114--
1114--
1115-- /Inhibits stream fusion/
1115-- /Inhibits stream fusion/
1116--
1116--
1117−-- /Internal/
1117+-- /Pre-release/
1118{-# INLINE_NORMAL onException #-}
1118{-# INLINE_NORMAL onException #-}
1119onException :: MonadCatch m => (a -> m c) -> Unfold m a b -> Unfold m a b
1119onException :: MonadCatch m => (a -> m c) -> Unfold m a b -> Unfold m a b
1120onException action (Unfold step1 inject1) = Unfold step inject
1120onException action (Unfold step1 inject1) = Unfold step inject
@@ -1147,7 +1147,7 @@ _finally action =
1147--
1147--
1148-- /Inhibits stream fusion/
1148-- /Inhibits stream fusion/
1149--
1149--
1150−-- /Internal/
1150+-- /Pre-release/
1151{-# INLINE_NORMAL finally_ #-}
1151{-# INLINE_NORMAL finally_ #-}
1152finally_ :: MonadCatch m => (a -> m c) -> Unfold m a b -> Unfold m a b
1152finally_ :: MonadCatch m => (a -> m c) -> Unfold m a b -> Unfold m a b
1153finally_ action (Unfold step1 inject1) = Unfold step inject
1153finally_ action (Unfold step1 inject1) = Unfold step inject
@@ -1181,7 +1181,7 @@ finally_ action (Unfold step1 inject1) = Unfold step inject
1181--
1181--
1182-- /Inhibits stream fusion/
1182-- /Inhibits stream fusion/
1183--
1183--
1184−-- /Internal/
1184+-- /Pre-release/
1185{-# INLINE_NORMAL finally #-}
1185{-# INLINE_NORMAL finally #-}
1186finally :: (MonadAsync m, MonadCatch m)
1186finally :: (MonadAsync m, MonadCatch m)
1187 => (a -> m c) -> Unfold m a b -> Unfold m a b
1187 => (a -> m c) -> Unfold m a b -> Unfold m a b
@@ -1220,7 +1220,7 @@ _bracket bef aft =
1220--
1220--
1221-- /Inhibits stream fusion/
1221-- /Inhibits stream fusion/
1222--
1222--
1223−-- /Internal/
1223+-- /Pre-release/
1224{-# INLINE_NORMAL bracket_ #-}
1224{-# INLINE_NORMAL bracket_ #-}
1225bracket_ :: MonadCatch m
1225bracket_ :: MonadCatch m
1226 => (a -> m c) -> (c -> m d) -> Unfold m c b -> Unfold m a b
1226 => (a -> m c) -> (c -> m d) -> Unfold m c b -> Unfold m a b
@@ -1262,7 +1262,7 @@ bracket_ bef aft (Unfold step1 inject1) = Unfold step inject
1262--
1262--
1263-- /Inhibits stream fusion/
1263-- /Inhibits stream fusion/
1264--
1264--
1265−-- /Internal/
1265+-- /Pre-release/
1266{-# INLINE_NORMAL bracket #-}
1266{-# INLINE_NORMAL bracket #-}
1267bracket :: (MonadAsync m, MonadCatch m)
1267bracket :: (MonadAsync m, MonadCatch m)
1268 => (a -> m c) -> (c -> m d) -> Unfold m c b -> Unfold m a b
1268 => (a -> m c) -> (c -> m d) -> Unfold m c b -> Unfold m a b
@@ -1295,7 +1295,7 @@ bracket bef aft (Unfold step1 inject1) = Unfold step inject
1295--
1295--
1296-- /Inhibits stream fusion/
1296-- /Inhibits stream fusion/
1297--
1297--
1298−-- /Internal/
1298+-- /Pre-release/
1299{-# INLINE_NORMAL handle #-}
1299{-# INLINE_NORMAL handle #-}
1300handle :: (MonadCatch m, Exception e)
1300handle :: (MonadCatch m, Exception e)
1301 => Unfold m e b -> Unfold m a b -> Unfold m a b
1301 => Unfold m e b -> Unfold m a b -> Unfold m a b
src/Streamly/Internal/Data/Unfold/Types.hs+4−4
@@ -63,7 +63,7 @@ data Unfold m a b =
63-- lmap f = concat (singleton f)
63-- lmap f = concat (singleton f)
64-- @
64-- @
65--
65--
66−-- /Internal/
66+-- /Pre-release/
67{-# INLINE_NORMAL lmap #-}
67{-# INLINE_NORMAL lmap #-}
68lmap :: (a -> c) -> Unfold m c b -> Unfold m a b
68lmap :: (a -> c) -> Unfold m c b -> Unfold m a b
69lmap f (Unfold ustep uinject) = Unfold ustep (uinject Prelude.. f)
69lmap f (Unfold ustep uinject) = Unfold ustep (uinject Prelude.. f)
@@ -74,7 +74,7 @@ lmap f (Unfold ustep uinject) = Unfold ustep (uinject Prelude.. f)
74
74
75-- | Map a function on the output of the unfold (the type @b@).
75-- | Map a function on the output of the unfold (the type @b@).
76--
76--
77−-- /Internal/
77+-- /Pre-release/
78{-# INLINE_NORMAL map #-}
78{-# INLINE_NORMAL map #-}
79map :: Functor m => (b -> c) -> Unfold m a b -> Unfold m a c
79map :: Functor m => (b -> c) -> Unfold m a b -> Unfold m a c
80map f (Unfold ustep uinject) = Unfold step uinject
80map f (Unfold ustep uinject) = Unfold step uinject
@@ -277,7 +277,7 @@ data ConcatState s1 s2 = ConcatOuter s1 | ConcatInner s1 s2
277-- | Apply the second unfold to each output element of the first unfold and
277-- | Apply the second unfold to each output element of the first unfold and
278-- flatten the output in a single stream.
278-- flatten the output in a single stream.
279--
279--
280−-- /Internal/
280+-- /Pre-release/
281--
281--
282{-# INLINE_NORMAL concat #-}
282{-# INLINE_NORMAL concat #-}
283concat :: Monad m => Unfold m a b -> Unfold m b c -> Unfold m a c
283concat :: Monad m => Unfold m a b -> Unfold m b c -> Unfold m a c
@@ -357,7 +357,7 @@ zipWithM f (Unfold step1 inject1) (Unfold step2 inject2) = Unfold step inject
357-- $ S.fromList [1..10]
357-- $ S.fromList [1..10]
358-- @
358-- @
359--
359--
360−-- /Internal/
360+-- /Pre-release/
361--
361--
362{-# INLINE zipWith #-}
362{-# INLINE zipWith #-}
363zipWith :: Monad m
363zipWith :: Monad m
src/Streamly/Internal/FileSystem/Dir.hs+3−3
@@ -194,7 +194,7 @@ readWithBufferOf = UF.concat readChunksWithBufferOf A.read
194-- | @toStreamWithBufferOf bufsize handle@ reads a byte stream from a file
194-- | @toStreamWithBufferOf bufsize handle@ reads a byte stream from a file
195-- handle, reads are performed in chunks of up to @bufsize@.
195-- handle, reads are performed in chunks of up to @bufsize@.
196--
196--
197−-- /Internal/
197+-- /Pre-release/
198{-# INLINE toStreamWithBufferOf #-}
198{-# INLINE toStreamWithBufferOf #-}
199toStreamWithBufferOf :: (IsStream t, MonadIO m) => Int -> Handle -> t m Word8
199toStreamWithBufferOf :: (IsStream t, MonadIO m) => Int -> Handle -> t m Word8
200toStreamWithBufferOf chunkSize h = AS.concat $ toChunksWithBufferOf chunkSize h
200toStreamWithBufferOf chunkSize h = AS.concat $ toChunksWithBufferOf chunkSize h
@@ -252,7 +252,7 @@ readDirs = UF.map (fromLeft undefined) $ UF.filter isLeft readEither
252
252
253-- | Raw read of a directory.
253-- | Raw read of a directory.
254--
254--
255−-- /Internal/
255+-- /Pre-release/
256{-# INLINE toStream #-}
256{-# INLINE toStream #-}
257toStream :: (IsStream t, MonadIO m) => String -> t m String
257toStream :: (IsStream t, MonadIO m) => String -> t m String
258toStream = S.unfold read
258toStream = S.unfold read
@@ -260,7 +260,7 @@ toStream = S.unfold read
260-- | Read directories as Left and files as Right. Filter out "." and ".."
260-- | Read directories as Left and files as Right. Filter out "." and ".."
261-- entries.
261-- entries.
262--
262--
263−-- /Internal/
263+-- /Pre-release/
264{-# INLINE toEither #-}
264{-# INLINE toEither #-}
265toEither :: (IsStream t, MonadIO m)
265toEither :: (IsStream t, MonadIO m)
266 => String -> t m (Either String String)
266 => String -> t m (Either String String)
src/Streamly/Internal/FileSystem/Event/Darwin.hs+36−36
@@ -182,7 +182,7 @@ import qualified Streamly.Internal.Data.Array.Foreign as A
182-- | Watch configuration, used to specify the events of interest and the
182-- | Watch configuration, used to specify the events of interest and the
183-- behavior of the watch.
183-- behavior of the watch.
184--
184--
185−-- /Internal/
185+-- /Pre-release/
186--
186--
187data Config = Config
187data Config = Config
188 { latency :: Double
188 { latency :: Double
@@ -211,7 +211,7 @@ data BatchInfo =
211--
211--
212-- /macOS 10.5+/
212-- /macOS 10.5+/
213--
213--
214−-- /Internal/
214+-- /Pre-release/
215--
215--
216setEventBatching :: BatchInfo -> Config -> Config
216setEventBatching :: BatchInfo -> Config -> Config
217setEventBatching batchInfo cfg@Config{..} =
217setEventBatching batchInfo cfg@Config{..} =
@@ -229,7 +229,7 @@ setEventBatching batchInfo cfg@Config{..} =
229
229
230-- | Whether a setting is 'On' or 'Off'.
230-- | Whether a setting is 'On' or 'Off'.
231--
231--
232−-- /Internal/
232+-- /Pre-release/
233--
233--
234data Toggle = On | Off
234data Toggle = On | Off
235
235
@@ -253,7 +253,7 @@ foreign import ccall safe
253--
253--
254-- /macOS 10.5+/
254-- /macOS 10.5+/
255--
255--
256−-- /Internal/
256+-- /Pre-release/
257--
257--
258setRootChanged :: Toggle -> Config -> Config
258setRootChanged :: Toggle -> Config -> Config
259setRootChanged = setFlag kFSEventStreamCreateFlagWatchRoot
259setRootChanged = setFlag kFSEventStreamCreateFlagWatchRoot
@@ -275,7 +275,7 @@ foreign import ccall safe
275--
275--
276-- /macOS 10.7+/
276-- /macOS 10.7+/
277--
277--
278−-- /Internal/
278+-- /Pre-release/
279--
279--
280setFileEvents :: Toggle -> Config -> Config
280setFileEvents :: Toggle -> Config -> Config
281setFileEvents = setFlag kFSEventStreamCreateFlagFileEvents
281setFileEvents = setFlag kFSEventStreamCreateFlagFileEvents
@@ -291,7 +291,7 @@ foreign import ccall safe
291--
291--
292-- /macOS 10.6+/
292-- /macOS 10.6+/
293--
293--
294−-- /Internal/
294+-- /Pre-release/
295--
295--
296setIgnoreSelf :: Toggle -> Config -> Config
296setIgnoreSelf :: Toggle -> Config -> Config
297setIgnoreSelf = setFlag kFSEventStreamCreateFlagIgnoreSelf
297setIgnoreSelf = setFlag kFSEventStreamCreateFlagIgnoreSelf
@@ -307,7 +307,7 @@ foreign import ccall safe
307--
307--
308-- /macOS 10.15+/
308-- /macOS 10.15+/
309--
309--
310−-- /Internal/
310+-- /Pre-release/
311--
311--
312setFullHistory :: Toggle -> Config -> Config
312setFullHistory :: Toggle -> Config -> Config
313setFullHistory = setFlag kFSEventStreamCreateFlagFullHistory
313setFullHistory = setFlag kFSEventStreamCreateFlagFullHistory
@@ -327,7 +327,7 @@ setFullHistory = setFlag kFSEventStreamCreateFlagFullHistory
327-- * 'setFullHistory' 'Off'
327-- * 'setFullHistory' 'Off'
328#endif
328#endif
329--
329--
330−-- /Internal/
330+-- /Pre-release/
331--
331--
332defaultConfig :: Config
332defaultConfig :: Config
333defaultConfig = setFileEvents On $ Config
333defaultConfig = setFileEvents On $ Config
@@ -390,7 +390,7 @@ data Watch = Watch Handle (Ptr CWatch) (MVar Bool)
390-- level thread is forked, creating a new watch stream is expensive. It is
390-- level thread is forked, creating a new watch stream is expensive. It is
391-- advised to minimize the number of watches.
391-- advised to minimize the number of watches.
392--
392--
393−-- /Internal/
393+-- /Pre-release/
394--
394--
395openWatch :: Config -> NonEmpty (Array Word8) -> IO Watch
395openWatch :: Config -> NonEmpty (Array Word8) -> IO Watch
396openWatch Config{..} paths = do
396openWatch Config{..} paths = do
@@ -425,7 +425,7 @@ openWatch Config{..} paths = do
425
425
426-- | Close a 'Watch' handle.
426-- | Close a 'Watch' handle.
427--
427--
428−-- /Internal/
428+-- /Pre-release/
429--
429--
430closeWatch :: Watch -> IO ()
430closeWatch :: Watch -> IO ()
431closeWatch (Watch h watchPtr mvar) = do
431closeWatch (Watch h watchPtr mvar) = do
@@ -441,7 +441,7 @@ closeWatch (Watch h watchPtr mvar) = do
441-- | An Event generated by the file system. Use the accessor functions to
441-- | An Event generated by the file system. Use the accessor functions to
442-- examine the event.
442-- examine the event.
443--
443--
444−-- /Internal/
444+-- /Pre-release/
445--
445--
446data Event = Event
446data Event = Event
447 { eventId :: Word64
447 { eventId :: Word64
@@ -508,7 +508,7 @@ watchToStream (Watch handle _ _) =
508-- watchTreesWith ('setIgnoreSelf' 'On' . 'setRootChanged' 'On') [Array.fromCString\# "path"#]
508-- watchTreesWith ('setIgnoreSelf' 'On' . 'setRootChanged' 'On') [Array.fromCString\# "path"#]
509-- @
509-- @
510--
510--
511−-- /Internal/
511+-- /Pre-release/
512--
512--
513watchTreesWith ::
513watchTreesWith ::
514 (Config -> Config) -> NonEmpty (Array Word8) -> SerialT IO Event
514 (Config -> Config) -> NonEmpty (Array Word8) -> SerialT IO Event
@@ -535,7 +535,7 @@ watchTrees = watchTreesWith id
535-- | Get the event id of an 'Event'. Event-id is a monotonically increasing
535-- | Get the event id of an 'Event'. Event-id is a monotonically increasing
536-- 64-bit integer identifying an event uniquely.
536-- 64-bit integer identifying an event uniquely.
537--
537--
538−-- /Internal/
538+-- /Pre-release/
539--
539--
540getEventId :: Event -> Word64
540getEventId :: Event -> Word64
541getEventId Event{..} = eventId
541getEventId Event{..} = eventId
@@ -551,7 +551,7 @@ foreign import ccall safe
551--
551--
552-- /macOS 10.5+/
552-- /macOS 10.5+/
553--
553--
554−-- /Internal/
554+-- /Pre-release/
555--
555--
556isEventIdWrapped :: Event -> Bool
556isEventIdWrapped :: Event -> Bool
557isEventIdWrapped = getFlag kFSEventStreamEventFlagEventIdsWrapped
557isEventIdWrapped = getFlag kFSEventStreamEventFlagEventIdsWrapped
@@ -559,7 +559,7 @@ isEventIdWrapped = getFlag kFSEventStreamEventFlagEventIdsWrapped
559-- | Get the absolute path of the file system object for which the event is
559-- | Get the absolute path of the file system object for which the event is
560-- generated. The path is a UTF-8 encoded array of bytes.
560-- generated. The path is a UTF-8 encoded array of bytes.
561--
561--
562−-- /Internal/
562+-- /Pre-release/
563--
563--
564getAbsPath :: Event -> Array Word8
564getAbsPath :: Event -> Array Word8
565getAbsPath Event{..} = eventAbsPath
565getAbsPath Event{..} = eventAbsPath
@@ -591,7 +591,7 @@ foreign import ccall safe
591--
591--
592-- /macOS 10.5+/
592-- /macOS 10.5+/
593--
593--
594−-- /Internal/
594+-- /Pre-release/
595--
595--
596isMustScanSubdirs :: Event -> Bool
596isMustScanSubdirs :: Event -> Bool
597isMustScanSubdirs = getFlag kFSEventStreamEventFlagMustScanSubDirs
597isMustScanSubdirs = getFlag kFSEventStreamEventFlagMustScanSubDirs
@@ -605,7 +605,7 @@ foreign import ccall safe
605--
605--
606-- /macOS 10.5+/
606-- /macOS 10.5+/
607--
607--
608−-- /Internal/
608+-- /Pre-release/
609--
609--
610isKernelDropped :: Event -> Bool
610isKernelDropped :: Event -> Bool
611isKernelDropped = getFlag kFSEventStreamEventFlagKernelDropped
611isKernelDropped = getFlag kFSEventStreamEventFlagKernelDropped
@@ -619,7 +619,7 @@ foreign import ccall safe
619--
619--
620-- /macOS 10.5+/
620-- /macOS 10.5+/
621--
621--
622−-- /Internal/
622+-- /Pre-release/
623--
623--
624isUserDropped :: Event -> Bool
624isUserDropped :: Event -> Bool
625isUserDropped = getFlag kFSEventStreamEventFlagUserDropped
625isUserDropped = getFlag kFSEventStreamEventFlagUserDropped
@@ -639,7 +639,7 @@ foreign import ccall safe
639--
639--
640-- /macOS 10.5+/
640-- /macOS 10.5+/
641--
641--
642−-- /Internal/
642+-- /Pre-release/
643--
643--
644isHistoryDone :: Event -> Bool
644isHistoryDone :: Event -> Bool
645isHistoryDone = getFlag kFSEventStreamEventFlagHistoryDone
645isHistoryDone = getFlag kFSEventStreamEventFlagHistoryDone
@@ -662,7 +662,7 @@ foreign import ccall safe
662--
662--
663-- /macOS 10.5+/
663-- /macOS 10.5+/
664--
664--
665−-- /Internal/
665+-- /Pre-release/
666--
666--
667isRootChanged :: Event -> Bool
667isRootChanged :: Event -> Bool
668isRootChanged = getFlag kFSEventStreamEventFlagRootChanged
668isRootChanged = getFlag kFSEventStreamEventFlagRootChanged
@@ -680,7 +680,7 @@ foreign import ccall safe
680--
680--
681-- /macOS 10.5+/
681-- /macOS 10.5+/
682--
682--
683−-- /Internal/
683+-- /Pre-release/
684--
684--
685isMount :: Event -> Bool
685isMount :: Event -> Bool
686isMount = getFlag kFSEventStreamEventFlagMount
686isMount = getFlag kFSEventStreamEventFlagMount
@@ -694,7 +694,7 @@ foreign import ccall safe
694--
694--
695-- /macOS 10.5+/
695-- /macOS 10.5+/
696--
696--
697−-- /Internal/
697+-- /Pre-release/
698--
698--
699isUnmount :: Event -> Bool
699isUnmount :: Event -> Bool
700isUnmount = getFlag kFSEventStreamEventFlagUnmount
700isUnmount = getFlag kFSEventStreamEventFlagUnmount
@@ -719,7 +719,7 @@ foreign import ccall safe
719--
719--
720-- /macOS 10.7+/
720-- /macOS 10.7+/
721--
721--
722−-- /Internal/
722+-- /Pre-release/
723--
723--
724isOwnerGroupModeChanged :: Event -> Bool
724isOwnerGroupModeChanged :: Event -> Bool
725isOwnerGroupModeChanged = getFlag kFSEventStreamEventFlagItemChangeOwner
725isOwnerGroupModeChanged = getFlag kFSEventStreamEventFlagItemChangeOwner
@@ -740,7 +740,7 @@ foreign import ccall safe
740--
740--
741-- /macOS 10.7+/
741-- /macOS 10.7+/
742--
742--
743−-- /Internal/
743+-- /Pre-release/
744--
744--
745isInodeAttrsChanged :: Event -> Bool
745isInodeAttrsChanged :: Event -> Bool
746isInodeAttrsChanged = getFlag kFSEventStreamEventFlagItemInodeMetaMod
746isInodeAttrsChanged = getFlag kFSEventStreamEventFlagItemInodeMetaMod
@@ -756,7 +756,7 @@ foreign import ccall safe
756--
756--
757-- /macOS 10.7+/
757-- /macOS 10.7+/
758--
758--
759−-- /Internal/
759+-- /Pre-release/
760--
760--
761isFinderInfoChanged :: Event -> Bool
761isFinderInfoChanged :: Event -> Bool
762isFinderInfoChanged = getFlag kFSEventStreamEventFlagItemFinderInfoMod
762isFinderInfoChanged = getFlag kFSEventStreamEventFlagItemFinderInfoMod
@@ -774,7 +774,7 @@ foreign import ccall safe
774--
774--
775-- /macOS 10.7+/
775-- /macOS 10.7+/
776--
776--
777−-- /Internal/
777+-- /Pre-release/
778--
778--
779isXAttrsChanged :: Event -> Bool
779isXAttrsChanged :: Event -> Bool
780isXAttrsChanged = getFlag kFSEventStreamEventFlagItemXattrMod
780isXAttrsChanged = getFlag kFSEventStreamEventFlagItemXattrMod
@@ -808,7 +808,7 @@ foreign import ccall safe
808--
808--
809-- /macOS 10.7+/
809-- /macOS 10.7+/
810--
810--
811−-- /Internal/
811+-- /Pre-release/
812--
812--
813isCreated :: Event -> Bool
813isCreated :: Event -> Bool
814isCreated = getFlag kFSEventStreamEventFlagItemCreated
814isCreated = getFlag kFSEventStreamEventFlagItemCreated
@@ -826,7 +826,7 @@ foreign import ccall safe
826--
826--
827-- /macOS 10.7+/
827-- /macOS 10.7+/
828--
828--
829−-- /Internal/
829+-- /Pre-release/
830--
830--
831isDeleted :: Event -> Bool
831isDeleted :: Event -> Bool
832isDeleted = getFlag kFSEventStreamEventFlagItemRemoved
832isDeleted = getFlag kFSEventStreamEventFlagItemRemoved
@@ -845,7 +845,7 @@ foreign import ccall safe
845--
845--
846-- /macOS 10.7+/
846-- /macOS 10.7+/
847--
847--
848−-- /Internal/
848+-- /Pre-release/
849--
849--
850isMoved :: Event -> Bool
850isMoved :: Event -> Bool
851isMoved = getFlag kFSEventStreamEventFlagItemRenamed
851isMoved = getFlag kFSEventStreamEventFlagItemRenamed
@@ -861,7 +861,7 @@ foreign import ccall safe
861--
861--
862-- /macOS 10.7+/
862-- /macOS 10.7+/
863--
863--
864−-- /Internal/
864+-- /Pre-release/
865--
865--
866isModified :: Event -> Bool
866isModified :: Event -> Bool
867isModified = getFlag kFSEventStreamEventFlagItemModified
867isModified = getFlag kFSEventStreamEventFlagItemModified
@@ -879,7 +879,7 @@ foreign import ccall safe
879--
879--
880-- /macOS 10.13+/
880-- /macOS 10.13+/
881--
881--
882−-- /Internal/
882+-- /Pre-release/
883--
883--
884isCloned :: Event -> Bool
884isCloned :: Event -> Bool
885isCloned = getFlag kFSEventStreamEventFlagItemCloned
885isCloned = getFlag kFSEventStreamEventFlagItemCloned
@@ -899,7 +899,7 @@ foreign import ccall safe
899--
899--
900-- /macOS 10.7+/
900-- /macOS 10.7+/
901--
901--
902−-- /Internal/
902+-- /Pre-release/
903--
903--
904isDir :: Event -> Bool
904isDir :: Event -> Bool
905isDir = getFlag kFSEventStreamEventFlagItemIsDir
905isDir = getFlag kFSEventStreamEventFlagItemIsDir
@@ -914,7 +914,7 @@ foreign import ccall safe
914--
914--
915-- /macOS 10.7+/
915-- /macOS 10.7+/
916--
916--
917−-- /Internal/
917+-- /Pre-release/
918--
918--
919isFile :: Event -> Bool
919isFile :: Event -> Bool
920isFile = getFlag kFSEventStreamEventFlagItemIsFile
920isFile = getFlag kFSEventStreamEventFlagItemIsFile
@@ -929,7 +929,7 @@ foreign import ccall safe
929--
929--
930-- /macOS 10.7+/
930-- /macOS 10.7+/
931--
931--
932−-- /Internal/
932+-- /Pre-release/
933--
933--
934isSymLink :: Event -> Bool
934isSymLink :: Event -> Bool
935isSymLink = getFlag kFSEventStreamEventFlagItemIsSymlink
935isSymLink = getFlag kFSEventStreamEventFlagItemIsSymlink
@@ -949,7 +949,7 @@ foreign import ccall safe
949--
949--
950-- /macOS 10.10+/
950-- /macOS 10.10+/
951--
951--
952−-- /Internal/
952+-- /Pre-release/
953--
953--
954isHardLink :: Event -> Bool
954isHardLink :: Event -> Bool
955isHardLink = getFlag kFSEventStreamEventFlagItemIsHardlink
955isHardLink = getFlag kFSEventStreamEventFlagItemIsHardlink
@@ -967,7 +967,7 @@ foreign import ccall safe
967--
967--
968-- /macOS 10.10+/
968-- /macOS 10.10+/
969--
969--
970−-- /Internal/
970+-- /Pre-release/
971--
971--
972isLastHardLink :: Event -> Bool
972isLastHardLink :: Event -> Bool
973isLastHardLink = getFlag kFSEventStreamEventFlagItemIsLastHardlink
973isLastHardLink = getFlag kFSEventStreamEventFlagItemIsLastHardlink
src/Streamly/Internal/FileSystem/Event/Linux.hs+52−52
@@ -200,7 +200,7 @@ import qualified Streamly.Internal.Unicode.Stream as U
200-- | Watch configuration, used to specify the events of interest and the
200-- | Watch configuration, used to specify the events of interest and the
201-- behavior of the watch.
201-- behavior of the watch.
202--
202--
203−-- /Internal/
203+-- /Pre-release/
204--
204--
205data Config = Config
205data Config = Config
206 { watchRec :: Bool
206 { watchRec :: Bool
@@ -213,7 +213,7 @@ data Config = Config
213
213
214-- | Whether a setting is 'On' or 'Off'.
214-- | Whether a setting is 'On' or 'Off'.
215--
215--
216−-- /Internal/
216+-- /Pre-release/
217--
217--
218data Toggle = On | Off
218data Toggle = On | Off
219
219
@@ -238,7 +238,7 @@ setFlag mask status cfg@Config{..} =
238--
238--
239-- /default: Off/
239-- /default: Off/
240--
240--
241−-- /Internal/
241+-- /Pre-release/
242--
242--
243setRecursiveMode :: Bool -> Config -> Config
243setRecursiveMode :: Bool -> Config -> Config
244setRecursiveMode rec cfg@Config{} = cfg {watchRec = rec}
244setRecursiveMode rec cfg@Config{} = cfg {watchRec = rec}
@@ -251,7 +251,7 @@ foreign import capi
251--
251--
252-- /default: On/
252-- /default: On/
253--
253--
254−-- /Internal/
254+-- /Pre-release/
255--
255--
256setFollowSymLinks :: Toggle -> Config -> Config
256setFollowSymLinks :: Toggle -> Config -> Config
257setFollowSymLinks s = setFlag iN_DONT_FOLLOW (toggle s)
257setFollowSymLinks s = setFlag iN_DONT_FOLLOW (toggle s)
@@ -264,7 +264,7 @@ foreign import capi
264--
264--
265-- /default: On/
265-- /default: On/
266--
266--
267−-- /Internal/
267+-- /Pre-release/
268--
268--
269setUnwatchMoved :: Toggle -> Config -> Config
269setUnwatchMoved :: Toggle -> Config -> Config
270setUnwatchMoved = setFlag iN_EXCL_UNLINK
270setUnwatchMoved = setFlag iN_EXCL_UNLINK
@@ -280,7 +280,7 @@ foreign import capi
280-- | What to do if a watch already exists when 'openWatch' or 'addToWatch' is
280-- | What to do if a watch already exists when 'openWatch' or 'addToWatch' is
281-- called for a path.
281-- called for a path.
282--
282--
283−-- /Internal/
283+-- /Pre-release/
284--
284--
285data WhenExists =
285data WhenExists =
286 AddIfExists -- ^ Do not set an existing setting to 'Off' only set to 'On'
286 AddIfExists -- ^ Do not set an existing setting to 'Off' only set to 'On'
@@ -294,7 +294,7 @@ data WhenExists =
294--
294--
295-- /default: FailIfExists/
295-- /default: FailIfExists/
296--
296--
297−-- /Internal/
297+-- /Pre-release/
298--
298--
299setWhenExists :: WhenExists -> Config -> Config
299setWhenExists :: WhenExists -> Config -> Config
300setWhenExists val cfg =
300setWhenExists val cfg =
@@ -312,7 +312,7 @@ foreign import capi
312--
312--
313-- /default: Off/
313-- /default: Off/
314--
314--
315−-- /Internal/
315+-- /Pre-release/
316--
316--
317setOneShot :: Toggle -> Config -> Config
317setOneShot :: Toggle -> Config -> Config
318setOneShot = setFlag iN_ONESHOT
318setOneShot = setFlag iN_ONESHOT
@@ -325,7 +325,7 @@ foreign import capi
325--
325--
326-- /default: Off/
326-- /default: Off/
327--
327--
328−-- /Internal/
328+-- /Pre-release/
329--
329--
330setOnlyDir :: Toggle -> Config -> Config
330setOnlyDir :: Toggle -> Config -> Config
331setOnlyDir = setFlag iN_ONLYDIR
331setOnlyDir = setFlag iN_ONLYDIR
@@ -341,7 +341,7 @@ foreign import capi
341--
341--
342-- /default: On/
342-- /default: On/
343--
343--
344−-- /Internal/
344+-- /Pre-release/
345--
345--
346setRootDeleted :: Toggle -> Config -> Config
346setRootDeleted :: Toggle -> Config -> Config
347setRootDeleted = setFlag iN_DELETE_SELF
347setRootDeleted = setFlag iN_DELETE_SELF
@@ -353,7 +353,7 @@ foreign import capi
353--
353--
354-- /default: On/
354-- /default: On/
355--
355--
356−-- /Internal/
356+-- /Pre-release/
357--
357--
358setRootMoved :: Toggle -> Config -> Config
358setRootMoved :: Toggle -> Config -> Config
359setRootMoved = setFlag iN_MOVE_SELF
359setRootMoved = setFlag iN_MOVE_SELF
@@ -366,7 +366,7 @@ foreign import capi
366--
366--
367-- /default: On/
367-- /default: On/
368--
368--
369−-- /Internal/
369+-- /Pre-release/
370--
370--
371setMetadataChanged :: Toggle -> Config -> Config
371setMetadataChanged :: Toggle -> Config -> Config
372setMetadataChanged = setFlag iN_ATTRIB
372setMetadataChanged = setFlag iN_ATTRIB
@@ -378,7 +378,7 @@ foreign import capi
378--
378--
379-- /default: On/
379-- /default: On/
380--
380--
381−-- /Internal/
381+-- /Pre-release/
382--
382--
383setAccessed :: Toggle -> Config -> Config
383setAccessed :: Toggle -> Config -> Config
384setAccessed = setFlag iN_ACCESS
384setAccessed = setFlag iN_ACCESS
@@ -390,7 +390,7 @@ foreign import capi
390--
390--
391-- /default: On/
391-- /default: On/
392--
392--
393−-- /Internal/
393+-- /Pre-release/
394--
394--
395setOpened :: Toggle -> Config -> Config
395setOpened :: Toggle -> Config -> Config
396setOpened = setFlag iN_OPEN
396setOpened = setFlag iN_OPEN
@@ -402,7 +402,7 @@ foreign import capi
402--
402--
403-- /default: On/
403-- /default: On/
404--
404--
405−-- /Internal/
405+-- /Pre-release/
406--
406--
407setWriteClosed :: Toggle -> Config -> Config
407setWriteClosed :: Toggle -> Config -> Config
408setWriteClosed = setFlag iN_CLOSE_WRITE
408setWriteClosed = setFlag iN_CLOSE_WRITE
@@ -414,7 +414,7 @@ foreign import capi
414--
414--
415-- /default: On/
415-- /default: On/
416--
416--
417−-- /Internal/
417+-- /Pre-release/
418--
418--
419setNonWriteClosed :: Toggle -> Config -> Config
419setNonWriteClosed :: Toggle -> Config -> Config
420setNonWriteClosed = setFlag iN_CLOSE_NOWRITE
420setNonWriteClosed = setFlag iN_CLOSE_NOWRITE
@@ -426,7 +426,7 @@ foreign import capi
426--
426--
427-- /default: On/
427-- /default: On/
428--
428--
429−-- /Internal/
429+-- /Pre-release/
430--
430--
431setCreated :: Toggle -> Config -> Config
431setCreated :: Toggle -> Config -> Config
432setCreated = setFlag iN_CREATE
432setCreated = setFlag iN_CREATE
@@ -438,7 +438,7 @@ foreign import capi
438--
438--
439-- /default: On/
439-- /default: On/
440--
440--
441−-- /Internal/
441+-- /Pre-release/
442--
442--
443setDeleted :: Toggle -> Config -> Config
443setDeleted :: Toggle -> Config -> Config
444setDeleted = setFlag iN_DELETE
444setDeleted = setFlag iN_DELETE
@@ -450,7 +450,7 @@ foreign import capi
450--
450--
451-- /default: On/
451-- /default: On/
452--
452--
453−-- /Internal/
453+-- /Pre-release/
454--
454--
455setMovedFrom :: Toggle -> Config -> Config
455setMovedFrom :: Toggle -> Config -> Config
456setMovedFrom = setFlag iN_MOVED_FROM
456setMovedFrom = setFlag iN_MOVED_FROM
@@ -462,7 +462,7 @@ foreign import capi
462--
462--
463-- /default: On/
463-- /default: On/
464--
464--
465−-- /Internal/
465+-- /Pre-release/
466--
466--
467setMovedTo :: Toggle -> Config -> Config
467setMovedTo :: Toggle -> Config -> Config
468setMovedTo = setFlag iN_MOVED_TO
468setMovedTo = setFlag iN_MOVED_TO
@@ -474,7 +474,7 @@ foreign import capi
474--
474--
475-- /default: On/
475-- /default: On/
476--
476--
477−-- /Internal/
477+-- /Pre-release/
478--
478--
479setModified :: Toggle -> Config -> Config
479setModified :: Toggle -> Config -> Config
480setModified = setFlag iN_MODIFY
480setModified = setFlag iN_MODIFY
@@ -483,7 +483,7 @@ setModified = setFlag iN_MODIFY
483--
483--
484-- /default: On/
484-- /default: On/
485--
485--
486−-- /Internal/
486+-- /Pre-release/
487--
487--
488setAllEvents :: Toggle -> Config -> Config
488setAllEvents :: Toggle -> Config -> Config
489setAllEvents s cfg =
489setAllEvents s cfg =
@@ -517,7 +517,7 @@ setAllEvents s cfg =
517-- * 'setWhenExists' 'AddIfExists'
517-- * 'setWhenExists' 'AddIfExists'
518-- * 'setAllEvents' 'On'
518-- * 'setAllEvents' 'On'
519--
519--
520−-- /Internal/
520+-- /Pre-release/
521--
521--
522defaultConfig :: Config
522defaultConfig :: Config
523defaultConfig =
523defaultConfig =
@@ -556,7 +556,7 @@ foreign import ccall unsafe
556-- | Create a 'Watch' handle. 'addToWatch' can be used to add paths being
556-- | Create a 'Watch' handle. 'addToWatch' can be used to add paths being
557-- monitored by this watch.
557-- monitored by this watch.
558--
558--
559−-- /Internal/
559+-- /Pre-release/
560--
560--
561createWatch :: IO Watch
561createWatch :: IO Watch
562createWatch = do
562createWatch = do
@@ -634,7 +634,7 @@ ensureTrailingSlash path =
634-- being monitored under @root@ via the watch handle @watch@. @root@ must be
634-- being monitored under @root@ via the watch handle @watch@. @root@ must be
635-- an absolute path and @subpath@ must be relative to @root@.
635-- an absolute path and @subpath@ must be relative to @root@.
636--
636--
637−-- /Internal/
637+-- /Pre-release/
638--
638--
639addToWatch :: Config -> Watch -> Array Word8 -> Array Word8 -> IO ()
639addToWatch :: Config -> Watch -> Array Word8 -> Array Word8 -> IO ()
640addToWatch cfg@Config{..} watch@(Watch handle wdMap) root0 path0 = do
640addToWatch cfg@Config{..} watch@(Watch handle wdMap) root0 path0 = do
@@ -698,7 +698,7 @@ foreign import ccall unsafe
698-- adding you need to provide the original path which was used to add the
698-- adding you need to provide the original path which was used to add the
699-- Watch.
699-- Watch.
700--
700--
701−-- /Internal/
701+-- /Pre-release/
702--
702--
703removeFromWatch :: Watch -> Array Word8 -> IO ()
703removeFromWatch :: Watch -> Array Word8 -> IO ()
704removeFromWatch (Watch handle wdMap) path = do
704removeFromWatch (Watch handle wdMap) path = do
@@ -722,7 +722,7 @@ removeFromWatch (Watch handle wdMap) path = do
722-- monitoring the paths for file system events. Returns a 'Watch' handle which
722-- monitoring the paths for file system events. Returns a 'Watch' handle which
723-- can then be used to read the event stream or to close the watch.
723-- can then be used to read the event stream or to close the watch.
724--
724--
725−-- /Internal/
725+-- /Pre-release/
726--
726--
727openWatch :: Config -> NonEmpty (Array Word8) -> IO Watch
727openWatch :: Config -> NonEmpty (Array Word8) -> IO Watch
728openWatch cfg paths = do
728openWatch cfg paths = do
@@ -732,7 +732,7 @@ openWatch cfg paths = do
732
732
733-- | Close a 'Watch' handle.
733-- | Close a 'Watch' handle.
734--
734--
735−-- /Internal/
735+-- /Pre-release/
736--
736--
737closeWatch :: Watch -> IO ()
737closeWatch :: Watch -> IO ()
738closeWatch (Watch h _) = hClose h
738closeWatch (Watch h _) = hClose h
@@ -746,7 +746,7 @@ newtype Cookie = Cookie Word32 deriving (Show, Eq)
746-- | An Event generated by the file system. Use the accessor functions to
746-- | An Event generated by the file system. Use the accessor functions to
747-- examine the event.
747-- examine the event.
748--
748--
749−-- /Internal/
749+-- /Pre-release/
750--
750--
751data Event = Event
751data Event = Event
752 { eventWd :: CInt
752 { eventWd :: CInt
@@ -856,7 +856,7 @@ watchToStream cfg wt@(Watch handle _) = do
856-- [Array.fromCString\# "dir"#]
856-- [Array.fromCString\# "dir"#]
857-- @
857-- @
858--
858--
859−-- /Internal/
859+-- /Pre-release/
860--
860--
861watchPathsWith ::
861watchPathsWith ::
862 (Config -> Config) -> NonEmpty (Array Word8) -> SerialT IO Event
862 (Config -> Config) -> NonEmpty (Array Word8) -> SerialT IO Event
@@ -868,7 +868,7 @@ watchPathsWith f = watchTreesWith (f . setRecursiveMode False)
868-- watchPaths = watchPathsWith id
868-- watchPaths = watchPathsWith id
869-- @
869-- @
870--
870--
871−-- /Internal/
871+-- /Pre-release/
872--
872--
873watchPaths :: NonEmpty (Array Word8) -> SerialT IO Event
873watchPaths :: NonEmpty (Array Word8) -> SerialT IO Event
874watchPaths = watchPathsWith id
874watchPaths = watchPathsWith id
@@ -897,7 +897,7 @@ watchPaths = watchPathsWith id
897--
897--
898-- See the Linux __inotify__ man page for more details.
898-- See the Linux __inotify__ man page for more details.
899--
899--
900−-- /Internal/
900+-- /Pre-release/
901--
901--
902watchTreesWith ::
902watchTreesWith ::
903 (Config -> Config) -> NonEmpty (Array Word8) -> SerialT IO Event
903 (Config -> Config) -> NonEmpty (Array Word8) -> SerialT IO Event
@@ -929,7 +929,7 @@ watchTrees = watchTreesWith id
929--
929--
930-- TBD: we can possibly update the watch root on a move self event.
930-- TBD: we can possibly update the watch root on a move self event.
931--
931--
932−-- /Internal/
932+-- /Pre-release/
933--
933--
934getRoot :: Event -> Array Word8
934getRoot :: Event -> Array Word8
935getRoot Event{..} =
935getRoot Event{..} =
@@ -946,7 +946,7 @@ getRoot Event{..} =
946-- | Get the file system object path for which the event is generated, relative
946-- | Get the file system object path for which the event is generated, relative
947-- to the watched root. The path is a "/" separated array of bytes.
947-- to the watched root. The path is a "/" separated array of bytes.
948--
948--
949−-- /Internal/
949+-- /Pre-release/
950--
950--
951getRelPath :: Event -> Array Word8
951getRelPath :: Event -> Array Word8
952getRelPath Event{..} = eventRelPath
952getRelPath Event{..} = eventRelPath
@@ -955,7 +955,7 @@ getRelPath Event{..} = eventRelPath
955-- | Get the absolute file system object path for which the event is generated.
955-- | Get the absolute file system object path for which the event is generated.
956-- The path is a "/" separated array of bytes.
956-- The path is a "/" separated array of bytes.
957--
957--
958−-- /Internal/
958+-- /Pre-release/
959--
959--
960getAbsPath :: Event -> Array Word8
960getAbsPath :: Event -> Array Word8
961getAbsPath ev = getRoot ev <> getRelPath ev
961getAbsPath ev = getRoot ev <> getRelPath ev
@@ -965,7 +965,7 @@ getAbsPath ev = getRoot ev <> getRelPath ev
965-- connect the 'isMovedFrom' and 'isMovedTo' events, if both the events belong
965-- connect the 'isMovedFrom' and 'isMovedTo' events, if both the events belong
966-- to the same move operation then they will have the same cookie value.
966-- to the same move operation then they will have the same cookie value.
967--
967--
968−-- /Internal/
968+-- /Pre-release/
969--
969--
970getCookie :: Event -> Cookie
970getCookie :: Event -> Cookie
971getCookie Event{..} = Cookie eventCookie
971getCookie Event{..} = Cookie eventCookie
@@ -993,7 +993,7 @@ foreign import capi
993-- some events.. The user application must scan everything under the watched
993-- some events.. The user application must scan everything under the watched
994-- paths to know the current state.
994-- paths to know the current state.
995--
995--
996−-- /Internal/
996+-- /Pre-release/
997--
997--
998isOverflow :: Event -> Bool
998isOverflow :: Event -> Bool
999isOverflow = getFlag iN_Q_OVERFLOW
999isOverflow = getFlag iN_Q_OVERFLOW
@@ -1012,7 +1012,7 @@ foreign import capi
1012--
1012--
1013-- /Occurs only for a watched path/
1013-- /Occurs only for a watched path/
1014--
1014--
1015−-- /Internal/
1015+-- /Pre-release/
1016--
1016--
1017isRootUnwatched :: Event -> Bool
1017isRootUnwatched :: Event -> Bool
1018isRootUnwatched = getFlag iN_IGNORED
1018isRootUnwatched = getFlag iN_IGNORED
@@ -1025,7 +1025,7 @@ isRootUnwatched = getFlag iN_IGNORED
1025--
1025--
1026-- /Occurs only for a watched path/
1026-- /Occurs only for a watched path/
1027--
1027--
1028−-- /Internal/
1028+-- /Pre-release/
1029--
1029--
1030isRootDeleted :: Event -> Bool
1030isRootDeleted :: Event -> Bool
1031isRootDeleted = getFlag iN_DELETE_SELF
1031isRootDeleted = getFlag iN_DELETE_SELF
@@ -1034,7 +1034,7 @@ isRootDeleted = getFlag iN_DELETE_SELF
1034--
1034--
1035-- /Occurs only for a watched path/
1035-- /Occurs only for a watched path/
1036--
1036--
1037−-- /Internal/
1037+-- /Pre-release/
1038--
1038--
1039isRootMoved :: Event -> Bool
1039isRootMoved :: Event -> Bool
1040isRootMoved = getFlag iN_MOVE_SELF
1040isRootMoved = getFlag iN_MOVE_SELF
@@ -1048,7 +1048,7 @@ foreign import capi
1048--
1048--
1049-- /Occurs only for a watched path/
1049-- /Occurs only for a watched path/
1050--
1050--
1051−-- /Internal/
1051+-- /Pre-release/
1052--
1052--
1053isRootUnmounted :: Event -> Bool
1053isRootUnmounted :: Event -> Bool
1054isRootUnmounted = getFlag iN_UNMOUNT
1054isRootUnmounted = getFlag iN_UNMOUNT
@@ -1069,7 +1069,7 @@ isRootUnmounted = getFlag iN_UNMOUNT
1069--
1069--
1070-- /Can occur for watched path or a file inside it/
1070-- /Can occur for watched path or a file inside it/
1071--
1071--
1072−-- /Internal/
1072+-- /Pre-release/
1073--
1073--
1074isMetadataChanged :: Event -> Bool
1074isMetadataChanged :: Event -> Bool
1075isMetadataChanged = getFlag iN_ATTRIB
1075isMetadataChanged = getFlag iN_ATTRIB
@@ -1082,7 +1082,7 @@ isMetadataChanged = getFlag iN_ATTRIB
1082--
1082--
1083-- /Occurs only for a file inside the watched directory/
1083-- /Occurs only for a file inside the watched directory/
1084--
1084--
1085−-- /Internal/
1085+-- /Pre-release/
1086--
1086--
1087isAccessed :: Event -> Bool
1087isAccessed :: Event -> Bool
1088isAccessed = getFlag iN_ACCESS
1088isAccessed = getFlag iN_ACCESS
@@ -1091,7 +1091,7 @@ isAccessed = getFlag iN_ACCESS
1091--
1091--
1092-- /Occurs only for a file inside the watched directory/
1092-- /Occurs only for a file inside the watched directory/
1093--
1093--
1094−-- /Internal/
1094+-- /Pre-release/
1095--
1095--
1096isOpened :: Event -> Bool
1096isOpened :: Event -> Bool
1097isOpened = getFlag iN_OPEN
1097isOpened = getFlag iN_OPEN
@@ -1100,7 +1100,7 @@ isOpened = getFlag iN_OPEN
1100--
1100--
1101-- /Occurs only for a file inside the watched directory/
1101-- /Occurs only for a file inside the watched directory/
1102--
1102--
1103−-- /Internal/
1103+-- /Pre-release/
1104--
1104--
1105isWriteClosed :: Event -> Bool
1105isWriteClosed :: Event -> Bool
1106isWriteClosed = getFlag iN_CLOSE_WRITE
1106isWriteClosed = getFlag iN_CLOSE_WRITE
@@ -1112,7 +1112,7 @@ isWriteClosed = getFlag iN_CLOSE_WRITE
1112--
1112--
1113-- /Can occur for watched path or a file inside it/
1113-- /Can occur for watched path or a file inside it/
1114--
1114--
1115−-- /Internal/
1115+-- /Pre-release/
1116--
1116--
1117isNonWriteClosed :: Event -> Bool
1117isNonWriteClosed :: Event -> Bool
1118isNonWriteClosed = getFlag iN_CLOSE_NOWRITE
1118isNonWriteClosed = getFlag iN_CLOSE_NOWRITE
@@ -1128,7 +1128,7 @@ isNonWriteClosed = getFlag iN_CLOSE_NOWRITE
1128--
1128--
1129-- /Occurs only for an object inside the watched directory/
1129-- /Occurs only for an object inside the watched directory/
1130--
1130--
1131−-- /Internal/
1131+-- /Pre-release/
1132--
1132--
1133isCreated :: Event -> Bool
1133isCreated :: Event -> Bool
1134isCreated = getFlag iN_CREATE
1134isCreated = getFlag iN_CREATE
@@ -1137,7 +1137,7 @@ isCreated = getFlag iN_CREATE
1137--
1137--
1138-- /Occurs only for an object inside the watched directory/
1138-- /Occurs only for an object inside the watched directory/
1139--
1139--
1140−-- /Internal/
1140+-- /Pre-release/
1141--
1141--
1142isDeleted :: Event -> Bool
1142isDeleted :: Event -> Bool
1143isDeleted = getFlag iN_DELETE
1143isDeleted = getFlag iN_DELETE
@@ -1150,7 +1150,7 @@ isDeleted = getFlag iN_DELETE
1150--
1150--
1151-- /Occurs only for an object inside the watched directory/
1151-- /Occurs only for an object inside the watched directory/
1152--
1152--
1153−-- /Internal/
1153+-- /Pre-release/
1154--
1154--
1155isMovedFrom :: Event -> Bool
1155isMovedFrom :: Event -> Bool
1156isMovedFrom = getFlag iN_MOVED_FROM
1156isMovedFrom = getFlag iN_MOVED_FROM
@@ -1160,7 +1160,7 @@ isMovedFrom = getFlag iN_MOVED_FROM
1160--
1160--
1161-- /Occurs only for an object inside the watched directory/
1161-- /Occurs only for an object inside the watched directory/
1162--
1162--
1163−-- /Internal/
1163+-- /Pre-release/
1164--
1164--
1165isMovedTo :: Event -> Bool
1165isMovedTo :: Event -> Bool
1166isMovedTo = getFlag iN_MOVED_TO
1166isMovedTo = getFlag iN_MOVED_TO
@@ -1170,7 +1170,7 @@ isMovedTo = getFlag iN_MOVED_TO
1170--
1170--
1171-- /Occurs only for an object inside the watched directory/
1171-- /Occurs only for an object inside the watched directory/
1172--
1172--
1173−-- /Internal/
1173+-- /Pre-release/
1174--
1174--
1175isModified :: Event -> Bool
1175isModified :: Event -> Bool
1176isModified = getFlag iN_MODIFY
1176isModified = getFlag iN_MODIFY
@@ -1184,7 +1184,7 @@ foreign import capi
1184
1184
1185-- | Determine whether the event is for a directory path.
1185-- | Determine whether the event is for a directory path.
1186--
1186--
1187−-- /Internal/
1187+-- /Pre-release/
1188--
1188--
1189isDir :: Event -> Bool
1189isDir :: Event -> Bool
1190isDir = getFlag iN_ISDIR
1190isDir = getFlag iN_ISDIR
src/Streamly/Internal/FileSystem/Event/Windows.hs+23−23
@@ -130,7 +130,7 @@ import Streamly.Internal.Data.Array.Foreign (Array)
130-- | Watch configuration, used to specify the events of interest and the
130-- | Watch configuration, used to specify the events of interest and the
131-- behavior of the watch.
131-- behavior of the watch.
132--
132--
133−-- /Internal/
133+-- /Pre-release/
134--
134--
135data Config = Config
135data Config = Config
136 { watchRec :: BOOL
136 { watchRec :: BOOL
@@ -143,7 +143,7 @@ data Config = Config
143
143
144-- | Whether a setting is 'On' or 'Off'.
144-- | Whether a setting is 'On' or 'Off'.
145--
145--
146−-- /Internal/
146+-- /Pre-release/
147--
147--
148data Toggle = On | Off
148data Toggle = On | Off
149
149
@@ -159,7 +159,7 @@ setFlag mask status cfg@Config{..} =
159--
159--
160-- /default: On/
160-- /default: On/
161--
161--
162−-- /Internal/
162+-- /Pre-release/
163--
163--
164setRecursiveMode :: BOOL -> Config -> Config
164setRecursiveMode :: BOOL -> Config -> Config
165setRecursiveMode rec cfg@Config{} = cfg {watchRec = rec}
165setRecursiveMode rec cfg@Config{} = cfg {watchRec = rec}
@@ -168,7 +168,7 @@ setRecursiveMode rec cfg@Config{} = cfg {watchRec = rec}
168--
168--
169-- /default: On/
169-- /default: On/
170--
170--
171−-- /Internal/
171+-- /Pre-release/
172--
172--
173setModifiedFileName :: Toggle -> Config -> Config
173setModifiedFileName :: Toggle -> Config -> Config
174setModifiedFileName = setFlag fILE_NOTIFY_CHANGE_FILE_NAME
174setModifiedFileName = setFlag fILE_NOTIFY_CHANGE_FILE_NAME
@@ -177,7 +177,7 @@ setModifiedFileName = setFlag fILE_NOTIFY_CHANGE_FILE_NAME
177--
177--
178-- /default: On/
178-- /default: On/
179--
179--
180−-- /Internal/
180+-- /Pre-release/
181--
181--
182setModifiedDirName :: Toggle -> Config -> Config
182setModifiedDirName :: Toggle -> Config -> Config
183setModifiedDirName = setFlag fILE_NOTIFY_CHANGE_DIR_NAME
183setModifiedDirName = setFlag fILE_NOTIFY_CHANGE_DIR_NAME
@@ -186,7 +186,7 @@ setModifiedDirName = setFlag fILE_NOTIFY_CHANGE_DIR_NAME
186--
186--
187-- /default: On/
187-- /default: On/
188--
188--
189−-- /Internal/
189+-- /Pre-release/
190--
190--
191setModifiedAttribute :: Toggle -> Config -> Config
191setModifiedAttribute :: Toggle -> Config -> Config
192setModifiedAttribute = setFlag fILE_NOTIFY_CHANGE_ATTRIBUTES
192setModifiedAttribute = setFlag fILE_NOTIFY_CHANGE_ATTRIBUTES
@@ -195,7 +195,7 @@ setModifiedAttribute = setFlag fILE_NOTIFY_CHANGE_ATTRIBUTES
195--
195--
196-- /default: On/
196-- /default: On/
197--
197--
198−-- /Internal/
198+-- /Pre-release/
199--
199--
200setModifiedSize :: Toggle -> Config -> Config
200setModifiedSize :: Toggle -> Config -> Config
201setModifiedSize = setFlag fILE_NOTIFY_CHANGE_SIZE
201setModifiedSize = setFlag fILE_NOTIFY_CHANGE_SIZE
@@ -204,7 +204,7 @@ setModifiedSize = setFlag fILE_NOTIFY_CHANGE_SIZE
204--
204--
205-- /default: On/
205-- /default: On/
206--
206--
207−-- /Internal/
207+-- /Pre-release/
208--
208--
209setModifiedLastWrite :: Toggle -> Config -> Config
209setModifiedLastWrite :: Toggle -> Config -> Config
210setModifiedLastWrite = setFlag fILE_NOTIFY_CHANGE_LAST_WRITE
210setModifiedLastWrite = setFlag fILE_NOTIFY_CHANGE_LAST_WRITE
@@ -213,7 +213,7 @@ setModifiedLastWrite = setFlag fILE_NOTIFY_CHANGE_LAST_WRITE
213--
213--
214-- /default: On/
214-- /default: On/
215--
215--
216−-- /Internal/
216+-- /Pre-release/
217--
217--
218setModifiedSecurity :: Toggle -> Config -> Config
218setModifiedSecurity :: Toggle -> Config -> Config
219setModifiedSecurity = setFlag fILE_NOTIFY_CHANGE_SECURITY
219setModifiedSecurity = setFlag fILE_NOTIFY_CHANGE_SECURITY
@@ -222,7 +222,7 @@ setModifiedSecurity = setFlag fILE_NOTIFY_CHANGE_SECURITY
222--
222--
223-- /default: On/
223-- /default: On/
224--
224--
225−-- /Internal/
225+-- /Pre-release/
226--
226--
227setAllEvents :: Toggle -> Config -> Config
227setAllEvents :: Toggle -> Config -> Config
228setAllEvents s =
228setAllEvents s =
@@ -394,7 +394,7 @@ utf8ToStringList = NonEmpty.map utf8ToString
394
394
395-- | Close a Directory handle.
395-- | Close a Directory handle.
396--
396--
397−-- /Internal/
397+-- /Pre-release/
398--
398--
399closePathHandleStream :: SerialT IO (HANDLE, FilePath, Config) -> IO ()
399closePathHandleStream :: SerialT IO (HANDLE, FilePath, Config) -> IO ()
400closePathHandleStream = S.mapM_ (\(h, _, _) -> closeHandle h)
400closePathHandleStream = S.mapM_ (\(h, _, _) -> closeHandle h)
@@ -406,7 +406,7 @@ closePathHandleStream = S.mapM_ (\(h, _, _) -> closeHandle h)
406-- contents of subdirectories are not monitored. Monitoring starts from the
406-- contents of subdirectories are not monitored. Monitoring starts from the
407-- current time onwards.
407-- current time onwards.
408--
408--
409−-- /Internal/
409+-- /Pre-release/
410--
410--
411watchPathsWith ::
411watchPathsWith ::
412 (Config -> Config)
412 (Config -> Config)
@@ -420,7 +420,7 @@ watchPathsWith f = watchTreesWith (f . setRecursiveMode False)
420-- watchPaths = watchPathsWith id
420-- watchPaths = watchPathsWith id
421-- @
421-- @
422--
422--
423−-- /Internal/
423+-- /Pre-release/
424--
424--
425watchPaths :: NonEmpty (Array Word8) -> SerialT IO Event
425watchPaths :: NonEmpty (Array Word8) -> SerialT IO Event
426watchPaths = watchPathsWith id
426watchPaths = watchPathsWith id
@@ -439,7 +439,7 @@ watchPaths = watchPathsWith id
439-- whole directory tree under it is watched recursively. Monitoring starts from
439-- whole directory tree under it is watched recursively. Monitoring starts from
440-- the current time onwards.
440-- the current time onwards.
441--
441--
442−-- /Internal/
442+-- /Pre-release/
443--
443--
444watchTreesWith ::
444watchTreesWith ::
445 (Config -> Config)
445 (Config -> Config)
@@ -485,7 +485,7 @@ getFlag mask Event{..} = eventFlags == mask
485-- | Get the file system object path for which the event is generated, relative
485-- | Get the file system object path for which the event is generated, relative
486-- to the watched root. The path is a UTF-8 encoded array of bytes.
486-- to the watched root. The path is a UTF-8 encoded array of bytes.
487--
487--
488−-- /Internal/
488+-- /Pre-release/
489--
489--
490getRelPath :: Event -> String
490getRelPath :: Event -> String
491getRelPath Event{..} = eventRelPath
491getRelPath Event{..} = eventRelPath
@@ -494,7 +494,7 @@ getRelPath Event{..} = eventRelPath
494--
494--
495-- | Get the watch root directory to which this event belongs.
495-- | Get the watch root directory to which this event belongs.
496--
496--
497−-- /Internal/
497+-- /Pre-release/
498--
498--
499getRoot :: Event -> String
499getRoot :: Event -> String
500getRoot Event{..} = ensureTrailingSlash eventRootPath
500getRoot Event{..} = ensureTrailingSlash eventRootPath
@@ -504,7 +504,7 @@ getRoot Event{..} = ensureTrailingSlash eventRootPath
504-- | Get the absolute file system object path for which the event is generated.
504-- | Get the absolute file system object path for which the event is generated.
505-- The path is a UTF-8 encoded array of bytes.
505-- The path is a UTF-8 encoded array of bytes.
506--
506--
507−-- /Internal/
507+-- /Pre-release/
508--
508--
509getAbsPath :: Event -> String
509getAbsPath :: Event -> String
510getAbsPath ev = getRoot ev <> getRelPath ev
510getAbsPath ev = getRoot ev <> getRelPath ev
@@ -513,14 +513,14 @@ getAbsPath ev = getRoot ev <> getRelPath ev
513--
513--
514-- | File/directory created in watched directory.
514-- | File/directory created in watched directory.
515--
515--
516−-- /Internal/
516+-- /Pre-release/
517--
517--
518isCreated :: Event -> Bool
518isCreated :: Event -> Bool
519isCreated = getFlag fILE_ACTION_ADDED
519isCreated = getFlag fILE_ACTION_ADDED
520
520
521-- | File/directory deleted from watched directory.
521-- | File/directory deleted from watched directory.
522--
522--
523−-- /Internal/
523+-- /Pre-release/
524--
524--
525isDeleted :: Event -> Bool
525isDeleted :: Event -> Bool
526isDeleted = getFlag fILE_ACTION_REMOVED
526isDeleted = getFlag fILE_ACTION_REMOVED
@@ -528,7 +528,7 @@ isDeleted = getFlag fILE_ACTION_REMOVED
528-- | Generated for the original path when an object is moved from under a
528-- | Generated for the original path when an object is moved from under a
529-- monitored directory.
529-- monitored directory.
530--
530--
531−-- /Internal/
531+-- /Pre-release/
532--
532--
533isMovedFrom :: Event -> Bool
533isMovedFrom :: Event -> Bool
534isMovedFrom = getFlag fILE_ACTION_RENAMED_OLD_NAME
534isMovedFrom = getFlag fILE_ACTION_RENAMED_OLD_NAME
@@ -536,7 +536,7 @@ isMovedFrom = getFlag fILE_ACTION_RENAMED_OLD_NAME
536-- | Generated for the new path when an object is moved under a monitored
536-- | Generated for the new path when an object is moved under a monitored
537-- directory.
537-- directory.
538--
538--
539−-- /Internal/
539+-- /Pre-release/
540--
540--
541isMovedTo :: Event -> Bool
541isMovedTo :: Event -> Bool
542isMovedTo = getFlag fILE_ACTION_RENAMED_NEW_NAME
542isMovedTo = getFlag fILE_ACTION_RENAMED_NEW_NAME
@@ -546,7 +546,7 @@ isMovedTo = getFlag fILE_ACTION_RENAMED_NEW_NAME
546-- | Determine whether the event indicates modification of an object within the
546-- | Determine whether the event indicates modification of an object within the
547-- monitored path.
547-- monitored path.
548--
548--
549−-- /Internal/
549+-- /Pre-release/
550--
550--
551isModified :: Event -> Bool
551isModified :: Event -> Bool
552isModified = getFlag fILE_ACTION_MODIFIED
552isModified = getFlag fILE_ACTION_MODIFIED
@@ -555,7 +555,7 @@ isModified = getFlag fILE_ACTION_MODIFIED
555-- therefore, events are lost. The user application must scan everything under
555-- therefore, events are lost. The user application must scan everything under
556-- the watched paths to know the current state.
556-- the watched paths to know the current state.
557--
557--
558−-- /Internal/
558+-- /Pre-release/
559--
559--
560isOverflow :: Event -> Bool
560isOverflow :: Event -> Bool
561isOverflow Event{..} = totalBytes == 0
561isOverflow Event{..} = totalBytes == 0
src/Streamly/Internal/FileSystem/File.hs+10−10
@@ -135,7 +135,7 @@ import qualified Streamly.Prelude as S
135-- this exception will be raised by 'withFile' rather than any exception
135-- this exception will be raised by 'withFile' rather than any exception
136-- raised by 'act'.
136-- raised by 'act'.
137--
137--
138−-- /Internal/
138+-- /Pre-release/
139--
139--
140{-# INLINE withFile #-}
140{-# INLINE withFile #-}
141withFile :: (IsStream t, MonadCatch m, MonadAsync m)
141withFile :: (IsStream t, MonadCatch m, MonadAsync m)
@@ -148,7 +148,7 @@ withFile file mode = S.bracket (liftIO $ openFile file mode) (liftIO . hClose)
148-- or in case of an exception. If closing the handle raises an exception, then
148-- or in case of an exception. If closing the handle raises an exception, then
149-- this exception will be raised by 'usingFile'.
149-- this exception will be raised by 'usingFile'.
150--
150--
151−-- /Internal/
151+-- /Pre-release/
152--
152--
153{-# INLINABLE usingFile #-}
153{-# INLINABLE usingFile #-}
154usingFile :: (MonadCatch m, MonadAsync m)
154usingFile :: (MonadCatch m, MonadAsync m)
@@ -234,7 +234,7 @@ toChunks = toChunksWithBufferOf defaultChunkSize
234-- @bufsize@. The size of an array in the resulting stream is always less than
234-- @bufsize@. The size of an array in the resulting stream is always less than
235-- or equal to @bufsize@.
235-- or equal to @bufsize@.
236--
236--
237−-- /Internal/
237+-- /Pre-release/
238--
238--
239{-# INLINE readChunksWithBufferOf #-}
239{-# INLINE readChunksWithBufferOf #-}
240readChunksWithBufferOf :: (MonadCatch m, MonadAsync m)
240readChunksWithBufferOf :: (MonadCatch m, MonadAsync m)
@@ -247,7 +247,7 @@ readChunksWithBufferOf = usingFile2 FH.readChunksWithBufferOf
247-- size of arrays in the resulting stream are therefore less than or equal to
247-- size of arrays in the resulting stream are therefore less than or equal to
248-- 'Streamly.Internal.Data.Array.Foreign.Types.defaultChunkSize'.
248-- 'Streamly.Internal.Data.Array.Foreign.Types.defaultChunkSize'.
249--
249--
250−-- /Internal/
250+-- /Pre-release/
251{-# INLINE readChunks #-}
251{-# INLINE readChunks #-}
252readChunks :: (MonadCatch m, MonadAsync m) => Unfold m FilePath (Array Word8)
252readChunks :: (MonadCatch m, MonadAsync m) => Unfold m FilePath (Array Word8)
253readChunks = usingFile FH.readChunks
253readChunks = usingFile FH.readChunks
@@ -255,7 +255,7 @@ readChunks = usingFile FH.readChunks
255-- | Unfolds the tuple @(bufsize, filepath)@ into a byte stream, read requests
255-- | Unfolds the tuple @(bufsize, filepath)@ into a byte stream, read requests
256-- to the IO device are performed using buffers of @bufsize@.
256-- to the IO device are performed using buffers of @bufsize@.
257--
257--
258−-- /Internal/
258+-- /Pre-release/
259{-# INLINE readWithBufferOf #-}
259{-# INLINE readWithBufferOf #-}
260readWithBufferOf :: (MonadCatch m, MonadAsync m) => Unfold m (Int, FilePath) Word8
260readWithBufferOf :: (MonadCatch m, MonadAsync m) => Unfold m (Int, FilePath) Word8
261readWithBufferOf = usingFile2 FH.readWithBufferOf
261readWithBufferOf = usingFile2 FH.readWithBufferOf
@@ -273,7 +273,7 @@ read = UF.concat (usingFile FH.readChunks) A.read
273-- when EOF is encountered. File is locked using multiple reader and single
273-- when EOF is encountered. File is locked using multiple reader and single
274-- writer locking mode.
274-- writer locking mode.
275--
275--
276−-- /Internal/
276+-- /Pre-release/
277--
277--
278{-# INLINE toBytes #-}
278{-# INLINE toBytes #-}
279toBytes :: (IsStream t, MonadCatch m, MonadAsync m) => FilePath -> t m Word8
279toBytes :: (IsStream t, MonadCatch m, MonadAsync m) => FilePath -> t m Word8
@@ -333,7 +333,7 @@ fromBytesWithBufferOf n file xs = fromChunks file $ AS.arraysOf n xs
333-- truncated to zero size before writing. If the file does not exist it is
333-- truncated to zero size before writing. If the file does not exist it is
334-- created. File is locked using single writer locking mode.
334-- created. File is locked using single writer locking mode.
335--
335--
336−-- /Internal/
336+-- /Pre-release/
337{-# INLINE fromBytes #-}
337{-# INLINE fromBytes #-}
338fromBytes :: (MonadAsync m, MonadCatch m) => FilePath -> SerialT m Word8 -> m ()
338fromBytes :: (MonadAsync m, MonadCatch m) => FilePath -> SerialT m Word8 -> m ()
339fromBytes = fromBytesWithBufferOf defaultChunkSize
339fromBytes = fromBytesWithBufferOf defaultChunkSize
@@ -347,7 +347,7 @@ write = toHandleWith A.defaultChunkSize
347-- | Write a stream of chunks to a handle. Each chunk in the stream is written
347-- | Write a stream of chunks to a handle. Each chunk in the stream is written
348-- to the device as a separate IO request.
348-- to the device as a separate IO request.
349--
349--
350−-- /Internal/
350+-- /Pre-release/
351{-# INLINE writeChunks #-}
351{-# INLINE writeChunks #-}
352writeChunks :: (MonadIO m, MonadCatch m, Storable a)
352writeChunks :: (MonadIO m, MonadCatch m, Storable a)
353 => FilePath -> Fold m (Array a) ()
353 => FilePath -> Fold m (Array a) ()
@@ -372,7 +372,7 @@ writeChunks path = Fold step initial extract
372-- Bytes in the input stream are collected into a buffer until we have a chunk
372-- Bytes in the input stream are collected into a buffer until we have a chunk
373-- of size @chunkSize@ and then written to the IO device.
373-- of size @chunkSize@ and then written to the IO device.
374--
374--
375−-- /Internal/
375+-- /Pre-release/
376{-# INLINE writeWithBufferOf #-}
376{-# INLINE writeWithBufferOf #-}
377writeWithBufferOf :: (MonadIO m, MonadCatch m)
377writeWithBufferOf :: (MonadIO m, MonadCatch m)
378 => Int -> FilePath -> Fold m Word8 ()
378 => Int -> FilePath -> Fold m Word8 ()
@@ -385,7 +385,7 @@ writeWithBufferOf n path =
385-- 'Streamly.Internal.Data.Array.Foreign.Types.defaultChunkSize' before writing to
385-- 'Streamly.Internal.Data.Array.Foreign.Types.defaultChunkSize' before writing to
386-- the IO device.
386-- the IO device.
387--
387--
388−-- /Internal/
388+-- /Pre-release/
389--
389--
390{-# INLINE write #-}
390{-# INLINE write #-}
391write :: (MonadIO m, MonadCatch m) => FilePath -> Fold m Word8 ()
391write :: (MonadIO m, MonadCatch m) => FilePath -> Fold m Word8 ()
src/Streamly/Internal/FileSystem/Handle.hs+8−8
@@ -237,7 +237,7 @@ toChunks = toChunksWithBufferOf defaultChunkSize
237--
237--
238-- > getChunks = toChunks stdin
238-- > getChunks = toChunks stdin
239--
239--
240−-- /Internal/
240+-- /Pre-release/
241--
241--
242{-# INLINE getChunks #-}
242{-# INLINE getChunks #-}
243getChunks :: (IsStream t, MonadIO m) => t m (Array Word8)
243getChunks :: (IsStream t, MonadIO m) => t m (Array Word8)
@@ -247,7 +247,7 @@ getChunks = toChunks stdin
247--
247--
248-- > getBytes = toBytes stdin
248-- > getBytes = toBytes stdin
249--
249--
250−-- /Internal/
250+-- /Pre-release/
251--
251--
252{-# INLINE getBytes #-}
252{-# INLINE getBytes #-}
253getBytes :: (IsStream t, MonadIO m) => t m Word8
253getBytes :: (IsStream t, MonadIO m) => t m Word8
@@ -283,7 +283,7 @@ readWithBufferOf = UF.concat readChunksWithBufferOf A.read
283-- | @toBytesWithBufferOf bufsize handle@ reads a byte stream from a file
283-- | @toBytesWithBufferOf bufsize handle@ reads a byte stream from a file
284-- handle, reads are performed in chunks of up to @bufsize@.
284-- handle, reads are performed in chunks of up to @bufsize@.
285--
285--
286−-- /Internal/
286+-- /Pre-release/
287{-# INLINE toBytesWithBufferOf #-}
287{-# INLINE toBytesWithBufferOf #-}
288toBytesWithBufferOf :: (IsStream t, MonadIO m) => Int -> Handle -> t m Word8
288toBytesWithBufferOf :: (IsStream t, MonadIO m) => Int -> Handle -> t m Word8
289toBytesWithBufferOf chunkSize h = AS.concat $ toChunksWithBufferOf chunkSize h
289toBytesWithBufferOf chunkSize h = AS.concat $ toChunksWithBufferOf chunkSize h
@@ -303,7 +303,7 @@ read = UF.supplyFirst readWithBufferOf defaultChunkSize
303
303
304-- | Generate a byte stream from a file 'Handle'.
304-- | Generate a byte stream from a file 'Handle'.
305--
305--
306−-- /Internal/
306+-- /Pre-release/
307{-# INLINE toBytes #-}
307{-# INLINE toBytes #-}
308toBytes :: (IsStream t, MonadIO m) => Handle -> t m Word8
308toBytes :: (IsStream t, MonadIO m) => Handle -> t m Word8
309toBytes = AS.concat . toChunks
309toBytes = AS.concat . toChunks
@@ -347,7 +347,7 @@ fromChunks h = S.mapM_ (liftIO . writeArray h)
347
347
348-- | Write a stream of chunks to standard output.
348-- | Write a stream of chunks to standard output.
349--
349--
350−-- /Internal/
350+-- /Pre-release/
351--
351--
352{-# INLINE putChunks #-}
352{-# INLINE putChunks #-}
353putChunks :: (MonadIO m, Storable a) => SerialT m (Array a) -> m ()
353putChunks :: (MonadIO m, Storable a) => SerialT m (Array a) -> m ()
@@ -357,7 +357,7 @@ putChunks = fromChunks stdout
357-- | Write a stream of strings to standard output using the supplied encoding.
357-- | Write a stream of strings to standard output using the supplied encoding.
358-- Output is flushed to the device for each string.
358-- Output is flushed to the device for each string.
359--
359--
360−-- /Internal/
360+-- /Pre-release/
361--
361--
362{-# INLINE putStrings #-}
362{-# INLINE putStrings #-}
363putStrings :: MonadAsync m
363putStrings :: MonadAsync m
@@ -369,7 +369,7 @@ putStrings encode = putChunks . S.mapM (IA.fromStream . encode . S.fromList)
369-- supplied encoding. Output is line buffered i.e. the output is written to the
369-- supplied encoding. Output is line buffered i.e. the output is written to the
370-- device as soon as a newline is encountered.
370-- device as soon as a newline is encountered.
371--
371--
372−-- /Internal/
372+-- /Pre-release/
373--
373--
374{-# INLINE putLines #-}
374{-# INLINE putLines #-}
375putLines :: MonadAsync m
375putLines :: MonadAsync m
@@ -381,7 +381,7 @@ putLines encode = putChunks . S.mapM
381--
381--
382-- > putBytes = fromBytes stdout
382-- > putBytes = fromBytes stdout
383--
383--
384−-- /Internal/
384+-- /Pre-release/
385--
385--
386{-# INLINE putBytes #-}
386{-# INLINE putBytes #-}
387putBytes :: MonadIO m => SerialT m Word8 -> m ()
387putBytes :: MonadIO m => SerialT m Word8 -> m ()
src/Streamly/Internal/Network/Inet/TCP.hs+7−7
@@ -208,7 +208,7 @@ connectionsOnAddrWith opts addr port =
208-- | Like 'connections' but binds on the specified IPv4 address of the machine
208-- | Like 'connections' but binds on the specified IPv4 address of the machine
209-- and listens for TCP connections on the specified port.
209-- and listens for TCP connections on the specified port.
210--
210--
211−-- /Internal/
211+-- /Pre-release/
212{-# INLINE connectionsOnAddr #-}
212{-# INLINE connectionsOnAddr #-}
213connectionsOnAddr
213connectionsOnAddr
214 :: MonadAsync m
214 :: MonadAsync m
@@ -223,7 +223,7 @@ connectionsOnAddr = connectionsOnAddrWith []
223--
223--
224-- > connectionsOnPort = connectionsOnAddr (0,0,0,0)
224-- > connectionsOnPort = connectionsOnAddr (0,0,0,0)
225--
225--
226−-- /Internal/
226+-- /Pre-release/
227{-# INLINE connectionsOnPort #-}
227{-# INLINE connectionsOnPort #-}
228connectionsOnPort :: MonadAsync m => PortNumber -> SerialT m Socket
228connectionsOnPort :: MonadAsync m => PortNumber -> SerialT m Socket
229connectionsOnPort = connectionsOnAddr (0,0,0,0)
229connectionsOnPort = connectionsOnAddr (0,0,0,0)
@@ -234,7 +234,7 @@ connectionsOnPort = connectionsOnAddr (0,0,0,0)
234--
234--
235-- > connectionsOnLocalHost = connectionsOnAddr (127,0,0,1)
235-- > connectionsOnLocalHost = connectionsOnAddr (127,0,0,1)
236--
236--
237−-- /Internal/
237+-- /Pre-release/
238{-# INLINE connectionsOnLocalHost #-}
238{-# INLINE connectionsOnLocalHost #-}
239connectionsOnLocalHost :: MonadAsync m => PortNumber -> SerialT m Socket
239connectionsOnLocalHost :: MonadAsync m => PortNumber -> SerialT m Socket
240connectionsOnLocalHost = connectionsOnAddr (127,0,0,1)
240connectionsOnLocalHost = connectionsOnAddr (127,0,0,1)
@@ -260,7 +260,7 @@ connect addr port = do
260-- closing the socket raises an exception, then this exception will be raised
260-- closing the socket raises an exception, then this exception will be raised
261-- by 'withConnectionM'.
261-- by 'withConnectionM'.
262--
262--
263−-- /Internal/
263+-- /Pre-release/
264{-# INLINABLE withConnectionM #-}
264{-# INLINABLE withConnectionM #-}
265withConnectionM :: (MonadMask m, MonadIO m)
265withConnectionM :: (MonadMask m, MonadIO m)
266 => (Word8, Word8, Word8, Word8) -> PortNumber -> (Socket -> m ()) -> m ()
266 => (Word8, Word8, Word8, Word8) -> PortNumber -> (Socket -> m ()) -> m ()
@@ -277,7 +277,7 @@ withConnectionM addr port =
277-- termination or in case of an exception. If closing the socket raises an
277-- termination or in case of an exception. If closing the socket raises an
278-- exception, then this exception will be raised by 'usingConnection'.
278-- exception, then this exception will be raised by 'usingConnection'.
279--
279--
280−-- /Internal/
280+-- /Pre-release/
281{-# INLINABLE usingConnection #-}
281{-# INLINABLE usingConnection #-}
282usingConnection :: (MonadCatch m, MonadAsync m)
282usingConnection :: (MonadCatch m, MonadAsync m)
283 => Unfold m Socket a
283 => Unfold m Socket a
@@ -297,7 +297,7 @@ usingConnection =
297-- handle raises an exception, then this exception will be raised by
297-- handle raises an exception, then this exception will be raised by
298-- 'withConnection' rather than any exception raised by 'act'.
298-- 'withConnection' rather than any exception raised by 'act'.
299--
299--
300−-- /Internal/
300+-- /Pre-release/
301{-# INLINABLE withConnection #-}
301{-# INLINABLE withConnection #-}
302withConnection :: (IsStream t, MonadCatch m, MonadAsync m)
302withConnection :: (IsStream t, MonadCatch m, MonadAsync m)
303 => (Word8, Word8, Word8, Word8) -> PortNumber -> (Socket -> t m a) -> t m a
303 => (Word8, Word8, Word8, Word8) -> PortNumber -> (Socket -> t m a) -> t m a
@@ -444,7 +444,7 @@ withInputConnect addr port input f = S.bracket pre post handler
444-- the host. The server host just acts as a transformation function on the
444-- the host. The server host just acts as a transformation function on the
445-- input stream. Both sending and receiving happen asynchronously.
445-- input stream. Both sending and receiving happen asynchronously.
446--
446--
447−-- /Internal/
447+-- /Pre-release/
448--
448--
449{-# INLINABLE transformBytesWith #-}
449{-# INLINABLE transformBytesWith #-}
450transformBytesWith
450transformBytesWith
src/Streamly/Internal/Network/Socket.hs+4−4
@@ -197,7 +197,7 @@ connectCommon SockSpec{..} local remote = withSocketsDo $ do
197-- | Connect to a remote host using the given socket specification and remote
197-- | Connect to a remote host using the given socket specification and remote
198-- address. Returns a connected socket or throws an exception.
198-- address. Returns a connected socket or throws an exception.
199--
199--
200−-- /Internal/
200+-- /Pre-release/
201--
201--
202{-# INLINE connect #-}
202{-# INLINE connect #-}
203connect :: SockSpec -> SockAddr -> IO Socket
203connect :: SockSpec -> SockAddr -> IO Socket
@@ -207,7 +207,7 @@ connect spec = connectCommon spec Nothing
207-- address to bind to and a remote address to connect to. Returns a connected
207-- address to bind to and a remote address to connect to. Returns a connected
208-- socket or throws an exception.
208-- socket or throws an exception.
209--
209--
210−-- /Internal/
210+-- /Pre-release/
211--
211--
212{-# INLINE connectFrom #-}
212{-# INLINE connectFrom #-}
213connectFrom :: SockSpec -> SockAddr -> SockAddr -> IO Socket
213connectFrom :: SockSpec -> SockAddr -> SockAddr -> IO Socket
@@ -236,7 +236,7 @@ recvConnectionTuplesWith tcpListenQ spec addr = S.unfoldrM step Nothing
236-- port). The server generates a stream of connected sockets. The first
236-- port). The server generates a stream of connected sockets. The first
237-- argument is the maximum number of pending connections in the backlog.
237-- argument is the maximum number of pending connections in the backlog.
238--
238--
239−-- /Internal/
239+-- /Pre-release/
240{-# INLINE connections #-}
240{-# INLINE connections #-}
241connections :: MonadAsync m => Int -> SockSpec -> SockAddr -> SerialT m Socket
241connections :: MonadAsync m => Int -> SockSpec -> SockAddr -> SerialT m Socket
242connections tcpListenQ spec addr =
242connections tcpListenQ spec addr =
@@ -473,7 +473,7 @@ writeChunksWithBufferOf n h = lpackArraysChunksOf n (writeChunks h)
473-- | Write a stream of strings to a socket in Latin1 encoding. Output is
473-- | Write a stream of strings to a socket in Latin1 encoding. Output is
474-- flushed to the socket for each string.
474-- flushed to the socket for each string.
475--
475--
476−-- /Internal/
476+-- /Pre-release/
477--
477--
478{-# INLINE writeStrings #-}
478{-# INLINE writeStrings #-}
479writeStrings :: MonadIO m
479writeStrings :: MonadIO m
src/Streamly/Internal/Unicode/Char.hs+1−1
@@ -32,7 +32,7 @@ import Data.Char (isAsciiUpper, isAsciiLower)
32
32
33-- | Select alphabetic characters in the ascii character set.
33-- | Select alphabetic characters in the ascii character set.
34--
34--
35−-- /Internal/
35+-- /Pre-release/
36--
36--
37{-# INLINE isAsciiAlpha #-}
37{-# INLINE isAsciiAlpha #-}
38isAsciiAlpha :: Char -> Bool
38isAsciiAlpha :: Char -> Bool
src/Streamly/Internal/Unicode/Stream.hs+10−10
@@ -683,7 +683,7 @@ decodeUtf8' = D.fromStreamD . decodeUtf8D' . D.toStreamD
683
683
684-- |
684-- |
685--
685--
686−-- /Internal/
686+-- /Pre-release/
687{-# INLINE decodeUtf8Arrays' #-}
687{-# INLINE decodeUtf8Arrays' #-}
688decodeUtf8Arrays' :: (MonadIO m, IsStream t) => t m (Array Word8) -> t m Char
688decodeUtf8Arrays' :: (MonadIO m, IsStream t) => t m (Array Word8) -> t m Char
689decodeUtf8Arrays' = D.fromStreamD . decodeUtf8ArraysD' . D.toStreamD
689decodeUtf8Arrays' = D.fromStreamD . decodeUtf8ArraysD' . D.toStreamD
@@ -716,7 +716,7 @@ decodeUtf8Lax = decodeUtf8
716
716
717-- |
717-- |
718--
718--
719−-- /Internal/
719+-- /Pre-release/
720{-# INLINE decodeUtf8Either #-}
720{-# INLINE decodeUtf8Either #-}
721decodeUtf8Either :: (Monad m, IsStream t)
721decodeUtf8Either :: (Monad m, IsStream t)
722 => t m Word8 -> t m (Either DecodeError Char)
722 => t m Word8 -> t m (Either DecodeError Char)
@@ -724,7 +724,7 @@ decodeUtf8Either = D.fromStreamD . decodeUtf8EitherD . D.toStreamD
724
724
725-- |
725-- |
726--
726--
727−-- /Internal/
727+-- /Pre-release/
728{-# INLINE resumeDecodeUtf8Either #-}
728{-# INLINE resumeDecodeUtf8Either #-}
729resumeDecodeUtf8Either
729resumeDecodeUtf8Either
730 :: (Monad m, IsStream t)
730 :: (Monad m, IsStream t)
@@ -737,7 +737,7 @@ resumeDecodeUtf8Either st cp =
737
737
738-- |
738-- |
739--
739--
740−-- /Internal/
740+-- /Pre-release/
741{-# INLINE decodeUtf8Arrays #-}
741{-# INLINE decodeUtf8Arrays #-}
742decodeUtf8Arrays ::
742decodeUtf8Arrays ::
743 (MonadIO m, IsStream t) => t m (Array Word8) -> t m Char
743 (MonadIO m, IsStream t) => t m (Array Word8) -> t m Char
@@ -746,7 +746,7 @@ decodeUtf8Arrays =
746
746
747-- |
747-- |
748--
748--
749−-- /Internal/
749+-- /Pre-release/
750{-# INLINE decodeUtf8Arrays_ #-}
750{-# INLINE decodeUtf8Arrays_ #-}
751decodeUtf8Arrays_ ::
751decodeUtf8Arrays_ ::
752 (MonadIO m, IsStream t) => t m (Array Word8) -> t m Char
752 (MonadIO m, IsStream t) => t m (Array Word8) -> t m Char
@@ -858,7 +858,7 @@ stripEnd = undefined
858--
858--
859-- > stripStart = S.dropWhile isSpace
859-- > stripStart = S.dropWhile isSpace
860--
860--
861−-- /Internal/
861+-- /Pre-release/
862{-# INLINE stripStart #-}
862{-# INLINE stripStart #-}
863stripStart :: (Monad m, IsStream t) => t m Char -> t m Char
863stripStart :: (Monad m, IsStream t) => t m Char -> t m Char
864stripStart = S.dropWhile isSpace
864stripStart = S.dropWhile isSpace
@@ -871,7 +871,7 @@ stripStart = S.dropWhile isSpace
871--
871--
872-- > lines = S.splitOnSuffix (== '\n')
872-- > lines = S.splitOnSuffix (== '\n')
873--
873--
874−-- /Internal/
874+-- /Pre-release/
875{-# INLINE lines #-}
875{-# INLINE lines #-}
876lines :: (Monad m, IsStream t) => Fold m Char b -> t m Char -> t m b
876lines :: (Monad m, IsStream t) => Fold m Char b -> t m Char -> t m b
877lines = S.splitOnSuffix (== '\n')
877lines = S.splitOnSuffix (== '\n')
@@ -896,7 +896,7 @@ isSpace c
896--
896--
897-- > words = S.wordsBy isSpace
897-- > words = S.wordsBy isSpace
898--
898--
899−-- /Internal/
899+-- /Pre-release/
900{-# INLINE words #-}
900{-# INLINE words #-}
901words :: (Monad m, IsStream t) => Fold m Char b -> t m Char -> t m b
901words :: (Monad m, IsStream t) => Fold m Char b -> t m Char -> t m b
902words = S.wordsBy isSpace
902words = S.wordsBy isSpace
@@ -908,7 +908,7 @@ words = S.wordsBy isSpace
908-- unlines = Stream.interposeSuffix '\n'
908-- unlines = Stream.interposeSuffix '\n'
909-- @
909-- @
910--
910--
911−-- /Internal/
911+-- /Pre-release/
912{-# INLINE unlines #-}
912{-# INLINE unlines #-}
913unlines :: (MonadIO m, IsStream t) => Unfold m a Char -> t m a -> t m Char
913unlines :: (MonadIO m, IsStream t) => Unfold m a Char -> t m a -> t m Char
914unlines = S.interposeSuffix '\n'
914unlines = S.interposeSuffix '\n'
@@ -921,7 +921,7 @@ unlines = S.interposeSuffix '\n'
921-- unwords = Stream.interpose ' '
921-- unwords = Stream.interpose ' '
922-- @
922-- @
923--
923--
924−-- /Internal/
924+-- /Pre-release/
925{-# INLINE unwords #-}
925{-# INLINE unwords #-}
926unwords :: (MonadIO m, IsStream t) => Unfold m a Char -> t m a -> t m Char
926unwords :: (MonadIO m, IsStream t) => Unfold m a Char -> t m a -> t m Char
927unwords = S.interpose ' '
927unwords = S.interpose ' '