onpartitions-0.1.0.0: partition lenses

Safe HaskellSafe
LanguageHaskell2010

Data.List.OnPartition

Contents

Description

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]

Synopsis

general

onPartitionG Source #

Arguments

:: (d -> Either c a)

partitioner

-> ([a] -> [b])

analyzer

-> [d] 
-> [Either c b] 

apply a function to the partitioned elements of a list, as a whole, changing their types

List partition like

onPartition Source #

Arguments

:: (a -> Bool)

partitioner

-> ([a] -> [a])

analyzer

-> [a] 
-> [a] 

apply a function to the partitioned elements of a list, as a whole

by index

onPartitionIndex Source #

Arguments

:: (Int -> Bool)

partitioner

-> ([a] -> [a])

analyzer

-> [a] 
-> [a] 

apply a function to the inedex partitioned elements of a list, as a whole

simple ones

onRights Source #

Arguments

:: ([a] -> [b])

analyzer

-> [Either l a] 
-> [Either l b] 

apply a function to the Right elements of a list, as a whole, changing their types

onOdds Source #

Arguments

:: ([a] -> [a])

analyzer

-> [a] 
-> [a] 

change the odds