on master help sign in
Fix smapM.

Closes #729.

commit69396964f17ff1713e38daf58ae199b658868e75 authorpranaysashank <pranaysashank@composewell.com> dateMon 26 Oct 2020, 13:33 (6 years ago) parent6da528b
1 file changed+4−5
src/Streamly/Internal/Data/Stream/IsStream.hs+4−5
src/Streamly/Internal/Data/Stream/IsStream.hs+4−5
@@ -2607,11 +2607,10 @@ smapM step initial stream =
26072607 -- (\(s, _) a -> step s a)
26082608 -- (fmap (,undefined) initial)
26092609 -- stream
2610− let r = concatMap
2611− (\s0 ->
2612− postscanlM' (\(s, _) a -> step s a) (return (s0, undefined)) stream
2613− )
2614− (yieldM initial)
2610+ let r = postscanlM'
2611+ (\(s, _) a -> step s a)
2612+ (fmap (,undefined) initial)
2613+ stream
26152614 in Serial.map snd r
26162615
26172616------------------------------------------------------------------------------