@@ -82,20 +82,20 @@ module Streamly.Internal.Data.Stream.IsStream.Transform
8282 -- | Produce a subset of the stream trimmed at ends.
8383
8484 , take
85− , takeByTime -- takeInterval
86− , takeEnd
87− , takeEndInterval
85+ , takeInterval
86+ , takeLast
87+ , takeLastInterval
8888 , takeWhile
8989 , takeWhileM
90− , takeWhileEnd
90+ , takeWhileLast
9191 , takeWhileAround
9292 , drop
93− , dropByTime -- dropInterval
94− , dropEnd
95− , dropEndInterval
93+ , dropInterval
94+ , dropLast
95+ , dropLastInterval
9696 , dropWhile
9797 , dropWhileM
98− , dropWhileEnd
98+ , dropWhileLast
9999 , dropWhileAround
100100
101101 -- * Inserting Elements
@@ -931,27 +931,27 @@ takeWhileM p m = fromStreamD $ D.takeWhileM p $ toStreamD m
931931
932932-- See the lastN fold for impl hints. Use a Data.Array based ring buffer.
933933--
934−-- takeEnd n = Stream.concatM . fmap Array.toStream . fold Fold.lastN
934+-- takeLast n = Stream.concatM . fmap Array.toStream . fold Fold.lastN
935935--
936936-- | Take @n@ elements at the end of the stream.
937937--
938938-- O(n) space, where n is the number elements taken.
939939--
940940-- /Unimplemented/
941−{-# INLINE takeEnd #-}
942−takeEnd :: -- (IsStream t, Monad m) =>
941+{-# INLINE takeLast #-}
942+takeLast :: -- (IsStream t, Monad m) =>
943943 Int -> t m a -> t m a
944−takeEnd = undefined -- fromStreamD $ D.takeEnd n $ toStreamD m
944+takeLast = undefined -- fromStreamD $ D.takeLast n $ toStreamD m
945945
946946-- | Take time interval @i@ seconds at the end of the stream.
947947--
948948-- O(n) space, where n is the number elements taken.
949949--
950950-- /Unimplemented/
951−{-# INLINE takeEndInterval #-}
952−takeEndInterval :: -- (IsStream t, Monad m) =>
951+{-# INLINE takeLastInterval #-}
952+takeLastInterval :: -- (IsStream t, Monad m) =>
953953 Double -> t m a -> t m a
954−takeEndInterval = undefined -- fromStreamD $ D.takeEnd n $ toStreamD m
954+takeLastInterval = undefined -- fromStreamD $ D.takeLast n $ toStreamD m
955955
956956-- | Take all consecutive elements at the end of the stream for which the
957957-- predicate is true.
@@ -959,12 +959,12 @@ takeEndInterval = undefined -- fromStreamD $ D.takeEnd n $ toStreamD m
959959-- O(n) space, where n is the number elements taken.
960960--
961961-- /Unimplemented/
962−{-# INLINE takeWhileEnd #-}
963−takeWhileEnd :: -- (IsStream t, Monad m) =>
962+{-# INLINE takeWhileLast #-}
963+takeWhileLast :: -- (IsStream t, Monad m) =>
964964 (a -> Bool) -> t m a -> t m a
965−takeWhileEnd = undefined -- fromStreamD $ D.takeWhileEnd n $ toStreamD m
965+takeWhileLast = undefined -- fromStreamD $ D.takeWhileLast n $ toStreamD m
966966
967−-- | Like 'takeWhile' and 'takeWhileEnd' combined.
967+-- | Like 'takeWhile' and 'takeWhileLast' combined.
968968--
969969-- O(n) space, where n is the number elements taken from the end.
970970--
@@ -974,7 +974,7 @@ takeWhileAround :: -- (IsStream t, Monad m) =>
974974 (a -> Bool) -> t m a -> t m a
975975takeWhileAround = undefined -- fromStreamD $ D.takeWhileAround n $ toStreamD m
976976
977−-- | @takeByTime duration@ yields stream elements upto specified time
977+-- | @takeInterval duration@ yields stream elements upto specified time
978978-- @duration@. The duration starts when the stream is evaluated for the first
979979-- time, before the first element is yielded. The time duration is checked
980980-- before generating each element, if the duration has expired the stream
@@ -990,9 +990,9 @@ takeWhileAround = undefined -- fromStreamD $ D.takeWhileAround n $ toStreamD m
990990--
991991-- /Pre-release/
992992--
993−{-# INLINE takeByTime #-}
994−takeByTime ::(MonadIO m, IsStream t, TimeUnit64 d) => d -> t m a -> t m a
995−takeByTime d = fromStreamD . D.takeByTime d . toStreamD
993+{-# INLINE takeInterval #-}
994+takeInterval ::(MonadIO m, IsStream t, TimeUnit64 d) => d -> t m a -> t m a
995+takeInterval d = fromStreamD . D.takeByTime d . toStreamD
996996
997997-- | Drop elements in the stream as long as the predicate succeeds and then
998998-- take the rest of the stream.
@@ -1009,7 +1009,7 @@ dropWhile p m = fromStreamS $ S.dropWhile p $ toStreamS m
10091009dropWhileM :: (IsStream t, Monad m) => (a -> m Bool) -> t m a -> t m a
10101010dropWhileM p m = fromStreamD $ D.dropWhileM p $ toStreamD m
10111011
1012−-- | @dropByTime duration@ drops stream elements until specified @duration@ has
1012+-- | @dropInterval duration@ drops stream elements until specified @duration@ has
10131013-- passed. The duration begins when the stream is evaluated for the first
10141014-- time. The time duration is checked /after/ generating a stream element, the
10151015-- element is yielded if the duration has expired otherwise it is dropped.
@@ -1023,29 +1023,29 @@ dropWhileM p m = fromStreamD $ D.dropWhileM p $ toStreamD m
10231023--
10241024-- /Pre-release/
10251025--
1026−{-# INLINE dropByTime #-}
1027−dropByTime ::(MonadIO m, IsStream t, TimeUnit64 d) => d -> t m a -> t m a
1028−dropByTime d = fromStreamD . D.dropByTime d . toStreamD
1026+{-# INLINE dropInterval #-}
1027+dropInterval ::(MonadIO m, IsStream t, TimeUnit64 d) => d -> t m a -> t m a
1028+dropInterval d = fromStreamD . D.dropByTime d . toStreamD
10291029
10301030-- | Drop @n@ elements at the end of the stream.
10311031--
10321032-- O(n) space, where n is the number elements dropped.
10331033--
10341034-- /Unimplemented/
1035−{-# INLINE dropEnd #-}
1036−dropEnd :: -- (IsStream t, Monad m) =>
1035+{-# INLINE dropLast #-}
1036+dropLast :: -- (IsStream t, Monad m) =>
10371037 Int -> t m a -> t m a
1038−dropEnd = undefined -- fromStreamD $ D.dropEnd n $ toStreamD m
1038+dropLast = undefined -- fromStreamD $ D.dropLast n $ toStreamD m
10391039
10401040-- | Drop time interval @i@ seconds at the end of the stream.
10411041--
10421042-- O(n) space, where n is the number elements dropped.
10431043--
10441044-- /Unimplemented/
1045−{-# INLINE dropEndInterval #-}
1046−dropEndInterval :: -- (IsStream t, Monad m) =>
1045+{-# INLINE dropLastInterval #-}
1046+dropLastInterval :: -- (IsStream t, Monad m) =>
10471047 Int -> t m a -> t m a
1048−dropEndInterval = undefined
1048+dropLastInterval = undefined
10491049
10501050-- | Drop all consecutive elements at the end of the stream for which the
10511051-- predicate is true.
@@ -1053,12 +1053,12 @@ dropEndInterval = undefined
10531053-- O(n) space, where n is the number elements dropped.
10541054--
10551055-- /Unimplemented/
1056−{-# INLINE dropWhileEnd #-}
1057−dropWhileEnd :: -- (IsStream t, Monad m) =>
1056+{-# INLINE dropWhileLast #-}
1057+dropWhileLast :: -- (IsStream t, Monad m) =>
10581058 (a -> Bool) -> t m a -> t m a
1059−dropWhileEnd = undefined -- fromStreamD $ D.dropWhileEnd n $ toStreamD m
1059+dropWhileLast = undefined -- fromStreamD $ D.dropWhileLast n $ toStreamD m
10601060
1061−-- | Like 'dropWhile' and 'dropWhileEnd' combined.
1061+-- | Like 'dropWhile' and 'dropWhileLast' combined.
10621062--
10631063-- O(n) space, where n is the number elements dropped from the end.
10641064--