on master help sign in
Strictify Fold accumulator in groupsOf & groupsOf2.
57c2ddcPranay Sashank
Changelog.md+2−1
@@ -4,7 +4,8 @@
4
4
5* Fix a bug that caused `findIndices` to return wrong indices in some
5* Fix a bug that caused `findIndices` to return wrong indices in some
6 cases.
6 cases.
7−* Fix a bug in `tap` that caused memory consumption to increase in some cases.
7+* Fix a bug in `tap`, `chunksOf` that caused memory consumption to
8+ increase in some cases.
8* Fix a space leak in `async` streams that caused memory consumption
9* Fix a space leak in `async` streams that caused memory consumption
9 to increase with the number of elements in the stream, especially when
10 to increase with the number of elements in the stream, especially when
10 built with `-threaded` and used with `-N` RTS option. The issue occurs
11 built with `-threaded` and used with `-N` RTS option. The issue occurs
src/Streamly/Internal/Data/Stream/StreamD/Type.hs+2−2
@@ -585,7 +585,7 @@ groupsOf n (Fold fstep initial extract) (Stream step state) =
585 r <- step (adaptState gst) st
585 r <- step (adaptState gst) st
586 case r of
586 case r of
587 Yield x s -> do
587 Yield x s -> do
588− fs' <- fstep fs x
588+ !fs' <- fstep fs x
589 let i' = i + 1
589 let i' = i + 1
590 return $
590 return $
591 if i' >= n
591 if i' >= n
@@ -629,7 +629,7 @@ groupsOf2 n input (Fold2 fstep inject extract) (Stream step state) =
629 r <- step (adaptState gst) st
629 r <- step (adaptState gst) st
630 case r of
630 case r of
631 Yield x s -> do
631 Yield x s -> do
632− fs' <- fstep fs x
632+ !fs' <- fstep fs x
633 let i' = i + 1
633 let i' = i + 1
634 return $
634 return $
635 if i' >= n
635 if i' >= n