packages feed

deferred-folds 0.9.7.1 → 0.9.8

raw patch · 2 files changed

+7/−1 lines, 2 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ DeferredFolds.Unfoldr: foldM :: Monad m => FoldM m input output -> Unfoldr input -> m output

Files

deferred-folds.cabal view
@@ -1,5 +1,5 @@ name: deferred-folds-version: 0.9.7.1+version: 0.9.8 category: Folding synopsis: Abstractions over deferred folds description:
library/DeferredFolds/Defs/Unfoldr.hs view
@@ -65,6 +65,12 @@ fold :: Fold input output -> Unfoldr input -> output fold (Fold step init extract) = extract . foldl' step init +{-| Apply a monadic Gonzalez fold -}+{-# INLINE foldM #-}+foldM :: Monad m => FoldM m input output -> Unfoldr input -> m output+foldM (FoldM step init extract) (Unfoldr unfoldr) =+  init >>= unfoldr (\ input next state -> step state input >>= next) return >>= extract+ {-| Construct from any foldable -} {-# INLINE foldable #-} foldable :: Foldable foldable => foldable a -> Unfoldr a