| 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
- takeNth :: Int -> (a -> Bool) -> [a] -> [a]
- takeWithFirst :: (a -> Bool) -> [a] -> [a]
- dropNth :: Int -> (a -> Bool) -> [a] -> [a]
- dropWithFirst :: (a -> Bool) -> [a] -> [a]
- bGroups :: (a -> Bool) -> (a -> [a]) -> [a] -> [a]
Operations on lists to take a part of a list
takeNth :: Int -> (a -> Bool) -> [a] -> [a] Source #
Function that takes a list containing elements consequently up to n occurencies of p a = True in map p [a]
takeWithFirst :: (a -> Bool) -> [a] -> [a] Source #
Function to take elements of the list till the first occurence of p a = True in 'map p [a]' including the element which results in the first occurance
dropNth :: Int -> (a -> Bool) -> [a] -> [a] Source #
Function that drops a list containing elements consequently up to n occurencies of p a = True in map p [a]
dropWithFirst :: (a -> Bool) -> [a] -> [a] Source #
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