packages feed

mmsyn5 0.1.0.0 → 0.1.1.0

raw patch · 3 files changed

+11/−5 lines, 3 filesPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

API changes (from Hackage documentation)

- Nth: bGroups :: (a -> Bool) -> (a -> [a]) -> [a] -> [a]
- Nth: dropNth :: Int -> (a -> Bool) -> [a] -> [a]
- Nth: dropWithFirst :: (a -> Bool) -> ([a] -> [a])
- Nth: takeNth :: Int -> (a -> Bool) -> [a] -> [a]
- Nth: takeWithFirst :: (a -> Bool) -> ([a] -> [a])
+ Data.List.Nth: bGroups :: (a -> Bool) -> (a -> [a]) -> [a] -> [a]
+ Data.List.Nth: dropNth :: Int -> (a -> Bool) -> [a] -> [a]
+ Data.List.Nth: dropWithFirst :: (a -> Bool) -> ([a] -> [a])
+ Data.List.Nth: takeNth :: Int -> (a -> Bool) -> [a] -> [a]
+ Data.List.Nth: takeWithFirst :: (a -> Bool) -> ([a] -> [a])

Files

ChangeLog.md view
@@ -6,3 +6,9 @@  most of them are taken from the mm1 project on GitHub    (https://github.com/OleksandrZhabenko/mm1). +## 0.1.1.0 -- 2019-11-04++* First version revised A. Fixed an issue with a module name. Some minor + documentation improvements.++
Data/List/Nth.hs view
@@ -8,7 +8,7 @@ -- Various additional operations on lists. -- -module Nth +module Data.List.Nth    (     -- * Operations on lists to take a part of a list        takeNth@@ -19,13 +19,13 @@        , bGroups   ) where --- | Function that takes a list containing elements consequently up to n occurencies of @p a = True@ in 'map p [a]'+-- | Function that takes a list containing elements consequently up to n occurencies of @p a = True@ in @map p [a]@ takeNth :: Int -> (a -> Bool) -> [a] -> [a] takeNth n p xs | n <= 0 = []                | otherwise =    takeWithFirst (not . p) xs ++ takeNth (n - 1) p (dropWithFirst p xs)  --- | Function that drops a list containing elements consequently up to n occurencies of @p a = True@ in 'map p [a]'+-- | Function that drops a list containing elements consequently up to n occurencies of @p a = True@ in @map p [a]@ dropNth :: Int -> (a -> Bool) -> [a] -> [a] dropNth n p xs | n <= 0 = xs                | otherwise = @@ -35,7 +35,7 @@ bGroups :: (a -> Bool) -> (a -> [a]) -> [a] -> [a] bGroups p f = concatMap (\x -> if p x then f x else [x]) --- | Function to take elements of the list after the first occurence of @p a = True@ in 'map p [a]' excluding the element which results in the first occurance+-- | Function to take elements of the list after the first occurence of @p a = True@ in @map p [a]@ excluding the element which results in the first occurance dropWithFirst :: (a -> Bool) -> ([a] -> [a]) dropWithFirst p = fst . foldr f v   where
mmsyn5.cabal view
@@ -2,7 +2,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/  name:                mmsyn5-version:             0.1.0.0+version:             0.1.1.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