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

Safe HaskellSafe
LanguageHaskell98

Data.Lens.Partial.Common

Contents

Synopsis

Documentation

newtype PartialLens a b Source #

Constructors

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

Instances

Tensor PartialLens Source # 

Methods

(***) :: PartialLens w x -> PartialLens y z -> PartialLens (w, y) (x, z) Source #

first :: PartialLens w x -> PartialLens (w, z) (x, z) Source #

second :: PartialLens y z -> PartialLens (w, y) (w, z) Source #

Category * PartialLens Source # 

Methods

id :: cat a a #

(.) :: cat b c -> cat a b -> cat a c #

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