deferred-folds 0.7.1 → 0.7.2
raw patch · 2 files changed
+9/−1 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ DeferredFolds.Unfoldr: zipWithIndex :: Unfoldr a -> Unfoldr (Int, a)
Files
deferred-folds.cabal view
@@ -1,5 +1,5 @@ name: deferred-folds-version: 0.7.1+version: 0.7.2 category: Folding synopsis: Abstractions over deferred folds description:
library/DeferredFolds/Defs/Unfoldr.hs view
@@ -152,3 +152,11 @@ -} reverse :: Unfoldr a -> Unfoldr a reverse (Unfoldr unfoldr) = Unfoldr $ \ step -> unfoldr (\ a f -> f . step a) id++{-|+Lift into an unfold, which produces pairs with index.+-}+zipWithIndex :: Unfoldr a -> Unfoldr (Int, a)+zipWithIndex (Unfoldr unfoldr) = Unfoldr $ \ step init -> snd $ unfoldr+ (\ a (index, state) -> (succ index, step (index, a) state))+ (0, init)