Strictify Fold accumulator in groupsOf & groupsOf2.
- Update Changelog.md to reflect the change in `chunksOf`.
commit57c2ddcc34c7576847b69728fabb09ffde7fc02d
authorPranay Sashank <pranaysashank@gmail.com>
dateThu 2 Jan 2020, 14:41 (7 years ago)
parent511828b
Changelog.md+2−1
@@ -4,7 +4,8 @@
44
55* Fix a bug that caused `findIndices` to return wrong indices in some
66 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.
89* Fix a space leak in `async` streams that caused memory consumption
910 to increase with the number of elements in the stream, especially when
1011 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) =
585585 r <- step (adaptState gst) st
586586 case r of
587587 Yield x s -> do
588− fs' <- fstep fs x
588+ !fs' <- fstep fs x
589589 let i' = i + 1
590590 return $
591591 if i' >= n
@@ -629,7 +629,7 @@ groupsOf2 n input (Fold2 fstep inject extract) (Stream step state) =
629629 r <- step (adaptState gst) st
630630 case r of
631631 Yield x s -> do
632− fs' <- fstep fs x
632+ !fs' <- fstep fs x
633633 let i' = i + 1
634634 return $
635635 if i' >= n