subG 0.4.1.0 → 0.4.2.0
raw patch · 3 files changed
+14/−1 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Data.SubG: partitionG :: (InsertLeft t a, Monoid (t a)) => (a -> Bool) -> t a -> (t a, t a)
Files
- CHANGELOG.md +4/−0
- Data/SubG.hs +9/−0
- subG.cabal +1/−1
CHANGELOG.md view
@@ -35,3 +35,7 @@ ## 0.4.1.0 -- 2020-11-19 * Fourth version revised A. Added two new functions mapG and filterG to the module.++## 0.4.2.0 -- 2020-11-19++* Fourth version revised B. Added two new functions partitionG to the module.
Data/SubG.hs view
@@ -33,6 +33,7 @@ , safeLastG , mapG , filterG+ , partitionG ) where import Prelude hiding (dropWhile, span, takeWhile)@@ -231,3 +232,11 @@ -- that is available at the URL: https://www.cs.nott.ac.uk/~pszgmh/fold.pdf. Acts similarly to 'filter' function from Prelude. filterG :: (InsertLeft t a, Monoid (t a)) => (a -> Bool) -> t a -> t a filterG p = F.foldr (\x ys -> if p x then x %@ ys else ys) mempty++-- | Inspired by: Graham Hutton. A tutorial on the universality and expressiveness of fold. /J. Functional Programming/ 9 (4): 355–372, July 1999.+-- that is available at the URL: https://www.cs.nott.ac.uk/~pszgmh/fold.pdf. Acts similarly to 'partition' function from Data.List. Practically is a+-- rewritten for more general variants function partition from https://hackage.haskell.org/package/base-4.14.0.0/docs/src/Data.OldList.html#partition+partitionG :: (InsertLeft t a, Monoid (t a)) => (a -> Bool) -> t a -> (t a, t a)+partitionG p = F.foldr (\x (ys,zs) -> if p x then (x %@ ys,zs) else (ys,x %@ zs)) (mempty,mempty)++
subG.cabal view
@@ -2,7 +2,7 @@ -- see http://haskell.org/cabal/users-guide/ name: subG-version: 0.4.1.0+version: 0.4.2.0 synopsis: Some extension to the Foldable and Monoid classes. description: Introduces a new class InsertLeft -- the class of types of values that can be inserted from the left to the Foldable structure that is a data that is also the Monoid instance. Also contains some functions to find out both minimum and maximum elements of the finite Foldable structures. homepage: https://hackage.haskell.org/package/subG