deferred-folds 0.2 → 0.2.1
raw patch · 2 files changed
+12/−1 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ DeferredFolds.FoldlView: intsInRange :: Int -> Int -> FoldlView Int
Files
deferred-folds.cabal view
@@ -1,7 +1,7 @@ name: deferred-folds version:- 0.2+ 0.2.1 category: Folding synopsis:
library/DeferredFolds/FoldlView.hs view
@@ -90,3 +90,14 @@ {-# INLINE foldable #-} foldable :: Foldable foldable => foldable a -> FoldlView a foldable foldable = FoldlView (\ step init -> A.foldl' step init foldable)++{-| Ints in the specified inclusive range -}+intsInRange :: Int -> Int -> FoldlView Int+intsInRange from to =+ FoldlView $ \ step init ->+ let+ loop !state int =+ if int <= to+ then loop (step state int) (succ int)+ else state+ in loop init from