data-lens-2.10.2: Haskell 98 Lenses

Safe HaskellSafe-Inferred

Data.Lens.Partial.Common

Contents

Synopsis

Documentation

newtype PartialLens a b

Constructors

PLens (a -> Maybe (Store b a)) 

totalLens :: Lens a b -> PartialLens a b

Functional API

getPL :: PartialLens a b -> a -> Maybe b

getorPL :: PartialLens a b -> b -> a -> b

getorAPL :: Applicative f => PartialLens a b -> f b -> a -> f b

nullPL :: PartialLens a b -> a -> Bool

getorEmptyPL :: Monoid o => PartialLens a b -> (b -> o) -> a -> o

sumPL :: Num c => PartialLens a b -> (b -> c) -> a -> c

productPL :: Num c => PartialLens a b -> (b -> c) -> a -> c

anyPL :: PartialLens a b -> (b -> Bool) -> a -> Bool

allPL :: PartialLens a b -> (b -> Bool) -> a -> Bool

trySetPL :: PartialLens a b -> a -> Maybe (b -> a)

setPL :: PartialLens a b -> b -> a -> a

modPL :: PartialLens a b -> (b -> b) -> a -> a

Operator API

(^$) :: PartialLens a b -> a -> Maybe b

(^.) :: a -> PartialLens a b -> Maybe b

(^=) :: PartialLens a b -> b -> a -> a

(^%=) :: PartialLens a b -> (b -> b) -> a -> a

(^%%=) :: Applicative f => PartialLens a b -> (b -> f b) -> a -> f a

applicative modify

Pseudo-imperatives

(^+=) :: Num b => PartialLens a b -> b -> a -> a

(^*=) :: Num b => PartialLens a b -> b -> a -> a

(^-=) :: Num b => PartialLens a b -> b -> a -> a

(^/=) :: Fractional b => PartialLens a b -> b -> a -> a

Stock partial lenses