foldl 1.0.4 → 1.0.5
raw patch · 2 files changed
+10/−2 lines, 2 filesdep ~basePVP ok
version bump matches the API change (PVP)
Dependency ranges changed: base
API changes (from Hackage documentation)
+ Control.Foldl: lastDef :: a -> Fold a a
Files
- foldl.cabal +1/−1
- src/Control/Foldl.hs +9/−1
foldl.cabal view
@@ -1,5 +1,5 @@ Name: foldl-Version: 1.0.4+Version: 1.0.5 Cabal-Version: >=1.8.0.2 Build-Type: Simple License: BSD3
src/Control/Foldl.hs view
@@ -26,7 +26,7 @@ -} -{-# LANGUAGE ExistentialQuantification, RankNTypes #-}+{-# LANGUAGE ExistentialQuantification, RankNTypes, Trustworthy #-} module Control.Foldl ( -- * Fold Types@@ -43,6 +43,7 @@ , foldMap , head , last+ , lastDef , null , length , and@@ -235,6 +236,13 @@ last :: Fold a (Maybe a) last = Fold (\_ -> Just') Nothing' lazy {-# INLINABLE last #-}++{-| Get the last element of a container or return a default value if the container+ is empty+-}+lastDef :: a -> Fold a a+lastDef a = Fold (\_ a' -> a') a id+{-# INLINABLE lastDef #-} -- | Returns 'True' if the container is empty, 'False' otherwise null :: Fold a Bool