| Copyright | (c) OleksandrZhabenko 2019 |
|---|---|
| License | MIT |
| Maintainer | olexandr543@yahoo.com |
| Safe Haskell | Safe |
| Language | Haskell2010 |
Data.List.Nth
Contents
Description
Various additional operations on lists.
Synopsis
- takeWithFirst :: (a -> Bool) -> [a] -> [a]
- takeNth :: Int -> (a -> Bool) -> [a] -> [a]
- dropWithFirst :: (a -> Bool) -> [a] -> [a]
- dropNth :: Int -> (a -> Bool) -> [a] -> [a]
- bGroups :: (a -> Bool) -> (a -> [a]) -> [a] -> [a]
Operations on lists to take a part of a list
takeWithFirst :: (a -> Bool) -> [a] -> [a] Source #
Function to take elements of the list till the first occurrence of p a = False in map p [a] including the element which results in the first occurrence (the first "wrong" element)
takeNth :: Int -> (a -> Bool) -> [a] -> [a] Source #
Function that takes a list containing elements consequently up to n occurrencies of p a = False in map p [a]
dropWithFirst :: (a -> Bool) -> [a] -> [a] Source #
Function to take elements of the list after the first occurrence of p a = False in map p [a] excluding the element which results in the first occurrence (the first "wrong" element)
dropNth :: Int -> (a -> Bool) -> [a] -> [a] Source #
Function that drops elements from a list consequently up to n occurrencies of p a = False in map p [a] including such occurrence