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

Safe HaskellSafe-Inferred
LanguageHaskell98

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 b Source

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

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

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

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

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

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

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

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

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

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

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

Operator API

(^$) :: PartialLens a b -> a -> Maybe b infixr 0 Source

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

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

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

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

applicative modify

Pseudo-imperatives

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

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

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

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

Stock partial lenses