on master help sign in
Add some todo comments
b98a3c1Harendra Kumar
src/Streamly/Prelude.hs+28
@@ -336,13 +336,21 @@ module Streamly.Prelude
336
336
337 -- ** Stateful Filters
337 -- ** Stateful Filters
338 , take
338 , take
339+ -- , takeEnd
339 , takeWhile
340 , takeWhile
340 , takeWhileM
341 , takeWhileM
342+ -- , takeWhileEnd
341 , drop
343 , drop
344+ -- , dropEnd
342 , dropWhile
345 , dropWhile
343 , dropWhileM
346 , dropWhileM
347+ -- , dropWhileEnd
348+ -- , dropAround
344 , deleteBy
349 , deleteBy
345 , uniq
350 , uniq
351+ -- , uniqBy -- by predicate e.g. to remove duplicate "/" in a path
352+ -- , uniqOn -- to remove duplicate sequences
353+ -- , pruneBy -- dropAround + uniqBy - like words
346
354
347 -- ** Mapping Filters
355 -- ** Mapping Filters
348 -- | Mapping along with filtering
356 -- | Mapping along with filtering
@@ -390,6 +398,8 @@ module Streamly.Prelude
390
398
391 , concatMapM
399 , concatMapM
392 , concatMap
400 , concatMap
401+ -- , interposeBy
402+ -- , intercalate
393
403
394 -- * Multi-Stream Operations
404 -- * Multi-Stream Operations
395 -- | New streams can be constructed by appending, merging or zipping
405 -- | New streams can be constructed by appending, merging or zipping
@@ -448,8 +458,12 @@ module Streamly.Prelude
448 , eqBy
458 , eqBy
449 , cmpBy
459 , cmpBy
450 , isPrefixOf
460 , isPrefixOf
461+ -- , isSuffixOf
462+ -- , isInfixOf
451 , isSubsequenceOf
463 , isSubsequenceOf
452 , stripPrefix
464 , stripPrefix
465+ -- , stripSuffix
466+ -- , stripInfix
453
467
454 -- * Deprecated
468 -- * Deprecated
455 , K.once
469 , K.once
@@ -946,11 +960,16 @@ foldrM = P.foldrM
946
960
947-- | Right fold to a streaming monad.
961-- | Right fold to a streaming monad.
948--
962--
963+-- > foldrS S.cons S.nil === id
964+--
949-- 'foldrS' can be used to perform stateless stream to stream transformations
965-- 'foldrS' can be used to perform stateless stream to stream transformations
950-- like map and filter in general. It can be coupled with a scan to perform
966-- like map and filter in general. It can be coupled with a scan to perform
951-- stateful transformations. However, note that the custom map and filter
967-- stateful transformations. However, note that the custom map and filter
952-- routines can be much more efficient than this due to better stream fusion.
968-- routines can be much more efficient than this due to better stream fusion.
953--
969--
970+-- >>> S.toList $ S.foldrS S.cons S.nil $ S.fromList [1..5]
971+-- > [1,2,3,4,5]
972+--
954-- Find if any element in the stream is 'True':
973-- Find if any element in the stream is 'True':
955--
974--
956-- >>> S.toList $ S.foldrS (\x xs -> if odd x then return True else xs) (return False) $ (S.fromList (2:4:5:undefined) :: SerialT IO Int)
975-- >>> S.toList $ S.foldrS (\x xs -> if odd x then return True else xs) (return False) $ (S.fromList (2:4:5:undefined) :: SerialT IO Int)
@@ -2095,3 +2114,12 @@ concatMap f m = fromStreamD $ D.concatMap (toStreamD . f) (toStreamD m)
2095{-# INLINE concatMapM #-}
2114{-# INLINE concatMapM #-}
2096concatMapM :: (IsStream t, Monad m) => (a -> m (t m b)) -> t m a -> t m b
2115concatMapM :: (IsStream t, Monad m) => (a -> m (t m b)) -> t m a -> t m b
2097concatMapM f m = fromStreamD $ D.concatMapM (fmap toStreamD . f) (toStreamD m)
2116concatMapM f m = fromStreamD $ D.concatMapM (fmap toStreamD . f) (toStreamD m)
2117+
2118+{-
2119+-- | A generalization of insertBy to inserting sequences.
2120+interposeBy :: (IsStream t, Monad m)
2121+ => (a -> a -> Ordering) -> t m a -> t m a -> t m a
2122+
2123+-- | A generalization of intersperseM to intersperse sequences.
2124+intercalate :: (IsStream t, MonadAsync m) => t m a -> t m a -> t m a
2125+-}