on master help sign in
Minor non-functional simplification in sliceSepBy and sliceEndWith
commit969f8c0e0aa3e5659070c8a6b506118f62f09116 authorAdithya Kumar <adithya@composewell.com> dateSun 14 Feb 2021, 00:14 (6 years ago) parentb04187b
1 file changed+2−6
src/Streamly/Internal/Data/Fold.hs+2−6
src/Streamly/Internal/Data/Fold.hs+2−6
@@ -1036,12 +1036,10 @@ splitAt n fld = splitWith (,) (takeLE n fld)
10361036{-# INLINE sliceSepBy #-}
10371037sliceSepBy :: Monad m => (a -> Bool) -> Fold m a b -> Fold m a b
10381038sliceSepBy predicate (Fold fstep finitial fextract) =
1039− Fold step initial fextract
1039+ Fold step finitial fextract
10401040
10411041 where
10421042
1043− initial = finitial
1044−
10451043 step s a =
10461044 if not (predicate a)
10471045 then fstep s a
@@ -1060,12 +1058,10 @@ sliceSepBy predicate (Fold fstep finitial fextract) =
10601058{-# INLINE sliceEndWith #-}
10611059sliceEndWith :: Monad m => (a -> Bool) -> Fold m a b -> Fold m a b
10621060sliceEndWith predicate (Fold fstep finitial fextract) =
1063− Fold step initial fextract
1061+ Fold step finitial fextract
10641062
10651063 where
10661064
1067− initial = finitial
1068−
10691065 step s a = do
10701066 res <- fstep s a
10711067 if not (predicate a)