on master help sign in
Fix smapM
commita78e05b4041cb48e364a2911ae795541fd0d5aa9 authorHarendra Kumar <harendra@composewell.com> dateSat 19 Sep 2020, 21:48 (6 years ago) parentdfc13d8
1 file changed+5−3
src/Streamly/Internal/Data/Stream/IsStream.hs+5−3
src/Streamly/Internal/Data/Stream/IsStream.hs+5−3
@@ -2598,13 +2598,15 @@ smapM :: (IsStream t, Monad m) =>
25982598 -> t m b
25992599smapM step initial stream =
26002600 -- XXX implement this directly instead of using scanlM'
2601− -- Once we have scanlM' with monadic initial we can use this code
2602− -- let r = scanlM'
2601+ -- Once we have postscanlM' with monadic initial we can use this code
2602+ -- let r = postscanlM'
26032603 -- (\(s, _) a -> step s a)
26042604 -- (fmap (,undefined) initial)
26052605 -- stream
26062606 let r = concatMap
2607− (\s0 -> scanlM' (\(s, _) a -> step s a) (s0, undefined) stream)
2607+ (\s0 ->
2608+ postscanlM' (\(s, _) a -> step s a) (s0, undefined) stream
2609+ )
26082610 (yieldM initial)
26092611 in Serial.map snd r
26102612