on master help sign in
Add docs regarding the eventual behaviour update of (<*>)
b9892e3Adithya Kumar
Changelog.md+5
@@ -1,5 +1,10 @@
1## Unreleased
1## Unreleased
2
2
3+### Notice
4+
5+* In the next major release the behaviour of `<*>` for folds will be updated
6+ from `teeWith` to `splitWith` to reflect it's similarity with parsers.
7+
3### Behavioral changes
8### Behavioral changes
4
9
5* `Streamly.Prelude.fold` can now terminate early without consuming the entire
10* `Streamly.Prelude.fold` can now terminate early without consuming the entire
src/Streamly/Internal/Data/Fold/Types.hs+6
@@ -413,10 +413,16 @@ data GenericRunner sL sR bL bR
413
413
414-- | The fold resulting from '<*>' distributes its input to both the argument
414-- | The fold resulting from '<*>' distributes its input to both the argument
415-- folds and combines their output using the supplied function.
415-- folds and combines their output using the supplied function.
416+--
417+-- __Note:__ The Applicative behaviour will change in the next major release.
418+--
416instance Monad m => Applicative (Fold m a) where
419instance Monad m => Applicative (Fold m a) where
417 {-# INLINE pure #-}
420 {-# INLINE pure #-}
418 pure = yield
421 pure = yield
419
422
423+ -- | __Notice:__ In the next major release the behaviour of @<*>@ for folds
424+ -- will be updated from 'teeWith' to 'splitWith' to reflect it's similarity
425+ -- with parsers.
420 {-# INLINE (<*>) #-}
426 {-# INLINE (<*>) #-}
421 (<*>) = teeWith ($)
427 (<*>) = teeWith ($)
422
428