on master help sign in
Add a code example to unzipWith & unzipWithM
9d62b7badithyaov
src/Streamly/Internal/Data/Fold.hs+4
@@ -1936,6 +1936,8 @@ classify fld = classifyWith fst (lmap snd fld)
1936
1936
1937-- | Like 'unzipWith' but with a monadic splitter function.
1937-- | Like 'unzipWith' but with a monadic splitter function.
1938--
1938--
1939+-- -- @unzipWithM f fld1 fld2 = lmapM f (unzip fld1 fld2)@
1940+--
1939-- @since 0.7.0
1941-- @since 0.7.0
1940{-# INLINE unzipWithM #-}
1942{-# INLINE unzipWithM #-}
1941unzipWithM :: Monad m
1943unzipWithM :: Monad m
@@ -2003,6 +2005,8 @@ unzipWithMinM = undefined
2003-- | Split elements in the input stream into two parts using a pure splitter
2005-- | Split elements in the input stream into two parts using a pure splitter
2004-- function, direct each part to a different fold and zip the results.
2006-- function, direct each part to a different fold and zip the results.
2005--
2007--
2008+-- @unzipWith f fld1 fld2 = lmap f (unzip fld1 fld2)@
2009+--
2006-- This fold terminates when both the input folds terminate.
2010-- This fold terminates when both the input folds terminate.
2007--
2011--
2008-- @since 0.7.0
2012-- @since 0.7.0