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

Safe HaskellSafe-Inferred
LanguageHaskell98

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 infixr 0

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

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

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

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

applicative modify

Pseudo-imperatives

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

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

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

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

Stock partial lenses