Safe Haskell | Safe |
---|---|
Language | Haskell98 |
- newtype PartialLens a b = PLens (a -> Maybe (Store b a))
- runPLens :: PartialLens a b -> a -> Sum Identity (Store b) a
- null :: PartialLens a b
- totalLens :: Lens a b -> PartialLens a b
- 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
- mergePL :: PartialLens a c -> PartialLens b c -> PartialLens (Either a b) c
- 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
- (^$) :: 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
- (^+=) :: 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
- justLens :: PartialLens (Maybe a) a
- leftLens :: PartialLens (Either a b) a
- rightLens :: PartialLens (Either a b) b
- headLens :: PartialLens [a] a
- tailLens :: PartialLens [a] [a]
Documentation
newtype PartialLens a b Source #
null :: PartialLens a b Source #
totalLens :: Lens a b -> PartialLens a b Source #
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 #
mergePL :: PartialLens a c -> PartialLens b c -> PartialLens (Either a b) c 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 #
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
justLens :: PartialLens (Maybe a) a Source #
leftLens :: PartialLens (Either a b) a Source #
rightLens :: PartialLens (Either a b) b Source #
headLens :: PartialLens [a] a Source #
tailLens :: PartialLens [a] [a] Source #