Fix the comparison order in groupsRollingBy
commit2f2d2268c26a544db2c343130acfe4494e32478f
authorHarendra Kumar <harendra.kumar@gmail.com>
dateSun 19 May 2019, 17:00 (7 years ago)
parentf310bed
src/Streamly/Streams/StreamD.hs+2−2
@@ -1042,7 +1042,7 @@ groupsRollingBy cmp f (Stream step state) =
10421042 res <- step (adaptState gst) stt
10431043 case res of
10441044 Yield x s -> do
1045− if cmp x prev
1045+ if cmp prev x
10461046 then do
10471047 acc' <- fstep acc x
10481048 go SPEC x s acc'
@@ -1061,7 +1061,7 @@ groupsRollingBy cmp f (Stream step state) =
10611061 res <- step (adaptState gst) stt
10621062 case res of
10631063 Yield x s -> do
1064− if cmp x prevv
1064+ if cmp prevv x
10651065 then do
10661066 acc' <- fstep acc x
10671067 go SPEC x s acc'