Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
tying-the-knot principle for a lens like over behaviour on list partitions
>>>
onOdds (tail . cycle) [1..10]
[3,2,5,4,7,6,9,8,1,10]
- onPartitionG :: (d -> Either c a) -> ([a] -> [b]) -> [d] -> [Either c b]
- onPartition :: (a -> Bool) -> ([a] -> [a]) -> [a] -> [a]
- onPartitionIndex :: (Int -> Bool) -> ([a] -> [a]) -> [a] -> [a]
- onRights :: ([a] -> [b]) -> [Either l a] -> [Either l b]
- onOdds :: ([a] -> [a]) -> [a] -> [a]
general
apply a function to the partitioned elements of a list, as a whole, changing their types
List
partition like
:: (a -> Bool) | partitioner |
-> ([a] -> [a]) | analyzer |
-> [a] | |
-> [a] |
apply a function to the partitioned elements of a list, as a whole
by index
apply a function to the inedex partitioned elements of a list, as a whole
simple ones
apply a function to the Right elements of a list, as a whole, changing their types