data-lens-2.10.5: Used to be Haskell 98 Lenses

Safe HaskellSafe-Inferred

Data.Lens.Partial.Common

Contents

Synopsis

Documentation

newtype PartialLens a b Source

Constructors

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

Functional API

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

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

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

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

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

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

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

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

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

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

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

Operator API

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

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

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

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

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

applicative modify

Pseudo-imperatives

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

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

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

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

Stock partial lenses