Hoogle Search
Within LTS Haskell 24.45 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
rmapM :: Monad m => (b -> m c) -> Fold m a b -> Fold m a cstreamly-core Streamly.Internal.Data.Fold Map a monadic function on the output of a fold.
rollingMapM :: Monad m => (Maybe a -> a -> m b) -> Fold m a bstreamly-core Streamly.Internal.Data.Fold Apply a function on every two successive elements of a stream. The first argument of the map function is the previous element and the second argument is the current element. When processing the very first element in the stream, the previous element is Nothing. Pre-release
-
streamly-core Streamly.Internal.Data.Fold Split the input stream based on a key field and fold each split using the given fold. Useful for map/reduce, bucketizing the input in different bins or for generating histograms. Example:
>>> import Data.Map.Strict (Map) >>> :{ let input = Stream.fromList [("ONE",1),("ONE",1.1),("TWO",2), ("TWO",2.2)] classify = Fold.toMap fst (Fold.lmap snd Fold.toList) in Stream.fold classify input :: IO (Map String [Double]) :} fromList [("ONE",[1.0,1.1]),("TWO",[2.0,2.2])]Once the classifier fold terminates for a particular key any further inputs in that bucket are ignored. Space used is proportional to the number of keys seen till now and monotonically increases because it stores whether a key has been seen or not. See demuxToMap for a more powerful version where you can use a different fold for each key. A simpler version of toMap retaining only the last value for a key can be written as:>>> toMap = Fold.foldl' (\kv (k, v) -> Map.insert k v kv) Map.empty
Stops: never Pre-release -
streamly-core Streamly.Internal.Data.Fold Same as toMap but maybe faster because it uses mutable cells as fold accumulators in the Map.
-
streamly-core Streamly.Internal.Data.Fold Map a function on the incoming as well as outgoing element of a rolling window fold.
>>> lmap f = Fold.lmap (bimap f (f <$>))
-
streamly-core Streamly.Internal.Data.Fold Apply a pure function on the latest and the oldest element of the window.
>>> windowRollingMap f = Fold.windowRollingMapM (\x y -> return $ f x y)
windowRollingMapM :: Monad m => (Maybe a -> a -> m (Maybe b)) -> Fold m (a, Maybe a) (Maybe b)streamly-core Streamly.Internal.Data.Fold Apply an effectful function on the latest and the oldest element of the window.
-
streamly-core Streamly.Internal.Data.Fold.Chunked Applies a fold on the input stream, generates the next fold from the output of the previously applied fold and then applies that fold. Pre-release
rmapM :: Monad m => (b -> m c) -> ChunkFold m a b -> ChunkFold m a cstreamly-core Streamly.Internal.Data.Fold.Chunked Map a monadic function on the output of a fold. Pre-release
module Streamly.Internal.Data.
IsMap No documentation available.