NonEmptyList 0.0.7 → 0.0.8
raw patch · 2 files changed
+11/−1 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Data.List.NonEmpty: suml :: (Semigroup a) => NonEmpty a -> a
+ Data.List.NonEmpty: sumr :: (Semigroup a) => NonEmpty a -> a
Files
- Data/List/NonEmpty.hs +10/−0
- NonEmptyList.cabal +1/−1
Data/List/NonEmpty.hs view
@@ -13,6 +13,8 @@ unsafeToNonEmpty, (.:), -- * List functions+ suml,+ sumr, reverse, scanl, scanl1,@@ -111,6 +113,14 @@ -> NonEmpty a -- ^ The non-empty list to prepend to. -> NonEmpty a a .: NonEmpty h t = NonEmpty a (h:t)++-- | Reduce left on the given non-empty list using a semigroup.+suml :: (Semigroup a) => NonEmpty a -> a+suml (NonEmpty h t) = L.foldl1' (.++.) (h:t)++-- | Reduce right on the given non-empty list using a semigroup.+sumr :: (Semigroup a) => NonEmpty a -> a+sumr (NonEmpty h t) = L.foldr1 (.++.) (h:t) -- | Reverses the elements of the (finite) non-empty list. reverse :: NonEmpty a
NonEmptyList.cabal view
@@ -1,5 +1,5 @@ Name: NonEmptyList-Version: 0.0.7+Version: 0.0.8 License: BSD3 License-File: LICENSE Synopsis: A list with a length of at least one.