on master help sign in
Remove splitAt.
04907e3Pranay Sashank
Changelog.md+1−1
@@ -2,7 +2,7 @@
2
2
3* Add benchmarks to measure composed and iterated operations
3* Add benchmarks to measure composed and iterated operations
4* Performance improvements
4* Performance improvements
5−* Add `(!!)`, `insertBy`, `mergeBy`, `merge`, `splitAt`, `the`, `maximumBy`,
5+* Add `(!!)`, `insertBy`, `mergeBy`, `merge`, `the`, `maximumBy`,
6 `minimumBy`, `scanl1`, `scanl1M`, `scanl1'`, `scanl1M'`, `scanl`, `scanlM`,
6 `minimumBy`, `scanl1`, `scanl1M`, `scanl1'`, `scanl1M'`, `scanl`, `scanlM`,
7 `deleteBy`, `isPrefixOf`, `isSubsequenceOf`, `stripPrefix`,
7 `deleteBy`, `isPrefixOf`, `isSubsequenceOf`, `stripPrefix`,
8 `replicate`, `generateM`, `generate`, `concatMap`, `concatMapM`,
8 `replicate`, `generateM`, `generate`, `concatMap`, `concatMapM`,
src/Streamly/Prelude.hs+1−7
@@ -211,7 +211,6 @@ module Streamly.Prelude
211 , drop
211 , drop
212 , dropWhile
212 , dropWhile
213 , dropWhileM
213 , dropWhileM
214− , splitAt
215
214
216 -- ** Inserting
215 -- ** Inserting
217 , intersperseM
216 , intersperseM
@@ -266,7 +265,7 @@ import Prelude
266 foldl, mapM, mapM_, sequence, all, any, sum, product, elem,
265 foldl, mapM, mapM_, sequence, all, any, sum, product, elem,
267 notElem, maximum, minimum, head, last, tail, length, null,
266 notElem, maximum, minimum, head, last, tail, length, null,
268 reverse, iterate, init, and, or, lookup, foldr1, (!!),
267 reverse, iterate, init, and, or, lookup, foldr1, (!!),
269− splitAt, scanl, scanl1, replicate, concatMap)
268+ scanl, scanl1, replicate, concatMap)
270import qualified Prelude
269import qualified Prelude
271import qualified System.IO as IO
270import qualified System.IO as IO
272
271
@@ -1046,11 +1045,6 @@ dropWhile p m = fromStreamS $ S.dropWhile p $ toStreamS m
1046dropWhileM :: (IsStream t, Monad m) => (a -> m Bool) -> t m a -> t m a
1045dropWhileM :: (IsStream t, Monad m) => (a -> m Bool) -> t m a -> t m a
1047dropWhileM p m = fromStreamD $ D.dropWhileM p $ toStreamD m
1046dropWhileM p m = fromStreamD $ D.dropWhileM p $ toStreamD m
1048
1047
1049−-- | Split the stream at position 'n'.
1050−{-# INLINE splitAt #-}
1051−splitAt :: (IsStream t, Monad m) => Int -> t m a -> (t m a, t m a)
1052−splitAt n m = (take n m, drop n m)
1053−
1054------------------------------------------------------------------------------
1048------------------------------------------------------------------------------
1055-- Transformation by Mapping
1049-- Transformation by Mapping
1056------------------------------------------------------------------------------
1050------------------------------------------------------------------------------
test/Prop.hs+1−7
@@ -334,7 +334,7 @@ functorOps constr desc eq t = do
334 prop (desc <> " fmap (+1)") $ transformFromList constr eq (fmap (+1)) $ t . fmap (+1)
334 prop (desc <> " fmap (+1)") $ transformFromList constr eq (fmap (+1)) $ t . fmap (+1)
335
335
336transformOps
336transformOps
337− :: (IsStream t, Semigroup (t IO Int))
337+ :: IsStream t
338 => ([Int] -> t IO Int)
338 => ([Int] -> t IO Int)
339 -> String
339 -> String
340 -> ([Int] -> [Int] -> Bool)
340 -> ([Int] -> [Int] -> Bool)
@@ -372,12 +372,6 @@ transformOps constr desc eq t = do
372 prop (desc <> " drop 1") $ transform (drop 1) $ t . S.drop 1
372 prop (desc <> " drop 1") $ transform (drop 1) $ t . S.drop 1
373 prop (desc <> " drop 10") $ transform (drop 10) $ t . S.drop 10
373 prop (desc <> " drop 10") $ transform (drop 10) $ t . S.drop 10
374
374
375− prop (desc <> " splitAt maxBound") $
376− transform (\xs -> let (x, y) = splitAt maxBound xs in x++y) $
377− t . (\m -> let (x,y) = S.splitAt maxBound m in x<>y)
378− {-prop (desc <> " splitAt 4") $ transform (splitAt 4) $ t . S.splitAt 4
379− prop (desc <> " splitAt 0") $ transform (splitAt 0) $ t . S.splitAt 0-}
380−
381 prop (desc <> " dropWhile True") $
375 prop (desc <> " dropWhile True") $
382 transform (dropWhile (const True)) $ t . S.dropWhile (const True)
376 transform (dropWhile (const True)) $ t . S.dropWhile (const True)
383 prop (desc <> " dropWhile False") $
377 prop (desc <> " dropWhile False") $