summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOleksandrZhabenko <>2019-11-08 13:45:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2019-11-08 13:45:00 (GMT)
commit17b2692041b5e8c0083021c4aa36bd712ce5c3c1 (patch)
treeb22baa55e2a1808b5d7627ee413c4b43b402bcdf
parentfda22711a5f4dd777779439179302f1a2714b545 (diff)
version 0.2.2.00.2.2.0
-rw-r--r--ChangeLog.md3
-rw-r--r--Data/List/InnToOut.hs5
-rw-r--r--mmsyn5.cabal2
3 files changed, 9 insertions, 1 deletions
diff --git a/ChangeLog.md b/ChangeLog.md
index 58ac26a..f64fa26 100644
--- a/ChangeLog.md
+++ b/ChangeLog.md
@@ -31,4 +31,7 @@
* Second version revised A. Changed the name of the module.
+## 0.2.2.0 -- 2019-11-08
+
+* Second version revised B. Added a new function mapI3.
diff --git a/Data/List/InnToOut.hs b/Data/List/InnToOut.hs
index 1703209..6c1aa9d 100644
--- a/Data/List/InnToOut.hs
+++ b/Data/List/InnToOut.hs
@@ -24,3 +24,8 @@ mapI p f = concatMap (\x -> if p x then f x else [x])
mapI2 :: (a -> Bool) -> (a -> b) -> (a -> [b]) -> [a] -> [b]
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#-}
diff --git a/mmsyn5.cabal b/mmsyn5.cabal
index d94cfe6..d7fd02c 100644
--- a/mmsyn5.cabal
+++ b/mmsyn5.cabal
@@ -2,7 +2,7 @@
-- documentation, see http://haskell.org/cabal/users-guide/
name: mmsyn5
-version: 0.2.1.0
+version: 0.2.2.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