mmsyn5 0.2.2.1 → 0.2.3.0
raw patch · 3 files changed
+26/−6 lines, 3 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Data.List.InnToOut: mapI3 :: (a -> Bool) -> (a -> b) -> (b -> d) -> (a -> c) -> (c -> d) -> [a] -> [d]
+ Data.List.InnToOut: mapI12 :: (a -> Bool) -> (a -> c) -> (a -> b) -> (b -> c) -> [a] -> [c]
+ Data.List.InnToOut: mapI21 :: (a -> Bool) -> (a -> b) -> (b -> c) -> (a -> c) -> [a] -> [c]
+ Data.List.InnToOut: mapI22 :: (a -> Bool) -> (a -> b) -> (b -> d) -> (a -> c) -> (c -> d) -> [a] -> [d]
Files
- ChangeLog.md +4/−0
- Data/List/InnToOut.hs +21/−5
- mmsyn5.cabal +1/−1
ChangeLog.md view
@@ -38,3 +38,7 @@ ## 0.2.2.1 -- 2019-11-08 * Second version revised C. Fixed documentation. ++## 0.2.3.0 -- 2019-11-08++* Second version revised D. Added two new functions (mapI12 and mapI21), renamed the mapI3 to mapI22.
Data/List/InnToOut.hs view
@@ -13,7 +13,9 @@ -- * Operation to apply a function that creates an inner list to an element of the outer list mapI , mapI2- , mapI3+ , mapI22+ , mapI12+ , mapI21 ) where -- | Function that applies additional function @f :: a -> [a]@ to @a@ if @p a = True@@@ -26,7 +28,21 @@ mapI2 p f g = concatMap (\x -> if p x then [f x] else g x) {-#INLINE mapI2#-} --- | Function that can apply two different ways of computing something depending of the predicate value @p :: a -> Bool@ for the @[a]@. Similar to arrow techniques.-mapI3 :: (a -> Bool) -> (a -> b) -> (b -> d) -> (a -> c) -> (c -> d) -> [a] -> [d]-mapI3 p f1 g f2 h = map (\x -> if p x then g (f1 x) else h (f2 x)) -{-#INLINE mapI3#-}+-- | Function that can apply two different ways of computing something depending of the predicate value @p :: a -> Bool@ and the structure of transition the data for the @[a]@. +-- It is used if there are two ways to transform data both of them consists of two applied functoins. Similar to arrow techniques.+mapI22 :: (a -> Bool) -> (a -> b) -> (b -> d) -> (a -> c) -> (c -> d) -> [a] -> [d]+mapI22 p f1 g f2 h = map (\x -> if p x then g (f1 x) else h (f2 x)) +{-#INLINE mapI22#-}++-- | Function that can apply two different ways of computing something depending of the predicate value @p :: a -> Bool@ and the structure of transition the data for the @[a]@. +-- It is used if there are two ways to transform data and the first one consists of one function and another -- from two applied consequently ones. Similar to arrow techniques.+mapI12 :: (a -> Bool) -> (a -> c) -> (a -> b) -> (b -> c) -> [a] -> [c]+mapI12 p f g h = map (\x -> if p x then f x else h (g x)) +{-#INLINE mapI12#-}++-- | Function that can apply two different ways of computing something depending of the predicate value @p :: a -> Bool@ and the structure of transition the data for the @[a]@. +-- It is used if there are two ways to transform data and the first one consists of two applied consequently functions and the second -- from one applied function. Similar to arrow techniques.+mapI21 :: (a -> Bool) -> (a -> b) -> (b -> c) -> (a -> c) -> [a] -> [c]+mapI21 p f g h = map (\x -> if p x then g (f x) else h x) +{-#INLINE mapI21#-}+
mmsyn5.cabal view
@@ -2,7 +2,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/ name: mmsyn5-version: 0.2.2.1+version: 0.2.3.0 synopsis: Various additional operations on lists description: A small library to deal with a little bit more complex operations on lists than Data.List module homepage: http://hackage.haskell.org/package/mmsyn5