on master help sign in
Updated type signature of `concatMapWith` to remove explicit forall.

- Do the same with `bindWith`, `concatMapBy`, `concatMapIterateWith`, `concatMapTreeWith`. - `concatMapLoopWith`,`concatMapTreeYieldLeavesWith` are not updated in the same way as they necessarily need the combining function to be polymorphic. - Update Changelog to reflect this change.

commit9d653d06d3e495465c01f943c82f02df4d57092c authorAhmed Zaheer Dadarkar <ahmed.dadarkar@gmail.com> dateFri 17 Apr 2020, 14:40 (6 years ago) parent4933d37
3 files changed+7−5
Changelog.md+2 src/Streamly/Internal/Data/Stream/StreamK/Type.hs+2−2 src/Streamly/Internal/Prelude.hs+3−3
Changelog.md+2
@@ -4,6 +4,8 @@
44
55* Change the signature of `foldlM'` to make the initial value of the
66 accumulator monadic.
7+* Change the signature of `concatMapWith` to ensure that it can be
8+ used with a wide variety of combining functions.
79
810### Bug Fixes
911
src/Streamly/Internal/Data/Stream/StreamK/Type.hs+2−2
@@ -1008,7 +1008,7 @@ apSerialDiscardSnd fstream stream = go1 fstream
10081008{-# INLINE bindWith #-}
10091009bindWith
10101010 :: IsStream t
1011− => (forall c. t m c -> t m c -> t m c)
1011+ => (t m b -> t m b -> t m b)
10121012 -> t m a
10131013 -> (a -> t m b)
10141014 -> t m b
@@ -1039,7 +1039,7 @@ bindWith par m1 f = go m1
10391039{-# INLINE concatMapBy #-}
10401040concatMapBy
10411041 :: IsStream t
1042− => (forall c. t m c -> t m c -> t m c)
1042+ => (t m b -> t m b -> t m b)
10431043 -> (a -> t m b)
10441044 -> t m a
10451045 -> t m b
src/Streamly/Internal/Prelude.hs+3−3
@@ -3036,7 +3036,7 @@ mergeAsyncByM f m1 m2 = fromStreamD $
30363036{-# INLINE concatMapWith #-}
30373037concatMapWith
30383038 :: IsStream t
3039− => (forall c. t m c -> t m c -> t m c)
3039+ => (t m b -> t m b -> t m b)
30403040 -> (a -> t m b)
30413041 -> t m a
30423042 -> t m b
@@ -3353,7 +3353,7 @@ interposeSuffix x unf str =
33533353{-# INLINE concatMapIterateWith #-}
33543354concatMapIterateWith
33553355 :: IsStream t
3356− => (forall c. t m c -> t m c -> t m c)
3356+ => (t m a -> t m a -> t m a)
33573357 -> (a -> t m a)
33583358 -> t m a
33593359 -> t m a
@@ -3388,7 +3388,7 @@ concatMapIterateWith combine f = concatMapWith combine go
33883388{-# INLINE concatMapTreeWith #-}
33893389concatMapTreeWith
33903390 :: IsStream t
3391− => (forall c. t m c -> t m c -> t m c)
3391+ => (t m (Either a b) -> t m (Either a b) -> t m (Either a b))
33923392 -> (a -> t m (Either a b))
33933393 -> t m (Either a b) -- Should be t m a?
33943394 -> t m (Either a b)