on master help sign in
Future-proof against potential Prelude.foldl' - part 2
fe3fd67Bodigrim
benchmark/Streamly/Benchmark/Data/Stream/Common.hs+1−1
@@ -103,7 +103,7 @@ import qualified Streamly.Internal.Data.Stream.StreamD as StreamK
103#endif
103#endif
104
104
105import Gauge
105import Gauge
106−import Prelude hiding (mapM, replicate)
106+import Prelude hiding (Foldable(..), mapM, replicate)
107
107
108#ifdef USE_STREAMK
108#ifdef USE_STREAMK
109toStream :: Applicative m => StreamK m a -> Stream m a
109toStream :: Applicative m => StreamK m a -> Stream m a
benchmark/Streamly/Benchmark/Data/Stream/StreamK.hs+4−4
@@ -26,7 +26,7 @@ import Control.Monad (when)
26import Data.Maybe (isJust)
26import Data.Maybe (isJust)
27import System.Random (randomRIO)
27import System.Random (randomRIO)
28import Prelude hiding
28import Prelude hiding
29− ( tail, mapM_, foldl, last, map, mapM, concatMap, zipWith, init, iterate
29+ ( Foldable(..), tail, mapM_, last, map, mapM, concatMap, zipWith, init, iterate
30 , repeat, replicate
30 , repeat, replicate
31 )
31 )
32
32
@@ -167,15 +167,15 @@ fromFoldable streamLen n = S.fromFoldable [n..n+streamLen]
167{-# INLINE fromFoldableM #-}
167{-# INLINE fromFoldableM #-}
168fromFoldableM :: Monad m => Int -> Int -> Stream m Int
168fromFoldableM :: Monad m => Int -> Int -> Stream m Int
169fromFoldableM streamLen n =
169fromFoldableM streamLen n =
170− Prelude.foldr S.consM S.nil (Prelude.fmap return [n..n+streamLen])
170+ List.foldr S.consM S.nil (Prelude.fmap return [n..n+streamLen])
171
171
172{-# INLINABLE concatMapFoldableWith #-}
172{-# INLINABLE concatMapFoldableWith #-}
173−concatMapFoldableWith :: Foldable f
173+concatMapFoldableWith :: P.Foldable f
174 => (Stream m b -> Stream m b -> Stream m b)
174 => (Stream m b -> Stream m b -> Stream m b)
175 -> (a -> Stream m b)
175 -> (a -> Stream m b)
176 -> f a
176 -> f a
177 -> Stream m b
177 -> Stream m b
178−concatMapFoldableWith f g = Prelude.foldr (f . g) S.nil
178+concatMapFoldableWith f g = P.foldr (f . g) S.nil
179
179
180{-# INLINE concatMapFoldableSerial #-}
180{-# INLINE concatMapFoldableSerial #-}
181concatMapFoldableSerial :: Int -> Int -> Stream m Int
181concatMapFoldableSerial :: Int -> Int -> Stream m Int
src/Streamly/Internal/Data/Stream/IsStream/Eliminate.hs+3−3
@@ -182,9 +182,9 @@ import qualified Streamly.Internal.Data.Stream.StreamK.Type as K
182import qualified System.IO as IO
182import qualified System.IO as IO
183
183
184import Prelude hiding
184import Prelude hiding
185− ( drop, take, takeWhile, foldr , foldl, mapM_, sequence, all, any, sum
185+ ( Foldable(..), drop, take, takeWhile, mapM_, sequence, all, any
186− , product, elem, notElem, maximum, minimum, head, last, tail, length
186+ , notElem, head, last, tail
187− , null , reverse, init, and, or, lookup, foldr1, (!!) , splitAt, break
187+ , reverse, init, and, or, lookup, (!!), splitAt, break
188 , mconcat)
188 , mconcat)
189
189
190-- $setup
190-- $setup
src/Streamly/Internal/Data/Stream/IsStream/Top.hs+1−1
@@ -85,7 +85,7 @@ import qualified Streamly.Internal.Data.Stream.IsStream.Transform as Stream
85import qualified Streamly.Internal.Data.Stream.IsStream.Type as IsStream
85import qualified Streamly.Internal.Data.Stream.IsStream.Type as IsStream
86import qualified Streamly.Internal.Data.Stream.StreamD as StreamD
86import qualified Streamly.Internal.Data.Stream.StreamD as StreamD
87
87
88−import Prelude hiding (filter, zipWith, concatMap, concat)
88+import Prelude hiding (Foldable(..), filter, zipWith, concatMap, concat)
89
89
90-- $setup
90-- $setup
91-- >>> :m
91-- >>> :m
src/Streamly/Internal/Data/Stream/IsStream/Type.hs+2−1
@@ -133,7 +133,8 @@ import qualified Streamly.Internal.Data.Stream.Serial as Stream
133import qualified Streamly.Internal.Data.Stream.Zip as Zip
133import qualified Streamly.Internal.Data.Stream.Zip as Zip
134import qualified Streamly.Internal.Data.Stream.ZipAsync as ZipAsync
134import qualified Streamly.Internal.Data.Stream.ZipAsync as ZipAsync
135
135
136−import Prelude hiding (foldr, repeat)
136+import Prelude hiding (Foldable(..), repeat)
137+import Data.Foldable (Foldable)
137
138
138#include "inline.hs"
139#include "inline.hs"
139
140
src/Streamly/Prelude.hs+4−4
@@ -943,10 +943,10 @@ where
943
943
944import Streamly.Internal.Control.Concurrent (MonadAsync)
944import Streamly.Internal.Control.Concurrent (MonadAsync)
945import Prelude
945import Prelude
946− hiding (filter, drop, dropWhile, take, takeWhile, zipWith, foldr,
946+ hiding (Foldable(..), filter, drop, dropWhile, take, takeWhile, zipWith,
947− foldl, map, mapM, mapM_, sequence, all, any, sum, product, elem,
947+ map, mapM, mapM_, sequence, all, any,
948− notElem, maximum, minimum, head, last, tail, length, null,
948+ notElem, head, last, tail,
949− reverse, iterate, init, and, or, lookup, foldr1, (!!),
949+ reverse, iterate, init, and, or, lookup, (!!),
950 scanl, scanl1, repeat, replicate, concatMap, span)
950 scanl, scanl1, repeat, replicate, concatMap, span)
951
951
952import Streamly.Internal.Data.Stream.IsStream
952import Streamly.Internal.Data.Stream.IsStream