Safe Haskell | Safe-Infered |
---|
Lens.Family2.Stock
Contents
Description
This module contains lenses for common structures in Haskell.
It also contains the lens combinators mergeL
and ***
.
- mergeL :: Functor f => RefFamily f a a' c c' -> RefFamily f b b' c c' -> RefFamily f (Either a b) (Either a' b') c c'
- (***) :: LensFamily a1 a1' b1 b1' -> LensFamily a2 a2' b2 b2' -> LensFamily (a1, a2) (a1', a2') (b1, b2) (b1', b2')
- fstL :: LensFamily (a, b) (a', b) a a'
- sndL :: LensFamily (a, b) (a, b') b b'
- funL :: Eq k => k -> Lens (k -> v) v
- mapL :: Ord k => k -> Lens (Map k v) (Maybe v)
- intMapL :: Int -> Lens (IntMap v) (Maybe v)
- setL :: Ord k => k -> Lens (Set k) Bool
- intSetL :: Int -> Lens IntSet Bool
- type LensFamily a a' b b' = forall f. Functor f => RefFamily f a a' b b'
- type Lens a b = LensFamily a a b b
Lens Combinators
mergeL :: Functor f => RefFamily f a a' c c' -> RefFamily f b b' c c' -> RefFamily f (Either a b) (Either a' b') c c'
Given two lens/getter/setter families with the same substructure, make a new lens/getter/setter on Either
.
(***) :: LensFamily a1 a1' b1 b1' -> LensFamily a2 a2' b2 b2' -> LensFamily (a1, a2) (a1', a2') (b1, b2) (b1', b2')Source
Given two lens families, make a new lens on their product.
Stock Lenses
fstL :: LensFamily (a, b) (a', b) a a'Source
Lens on the first element of a pair.
sndL :: LensFamily (a, b) (a, b') b b'Source
Lens on the second element of a pair.
Types
type LensFamily a a' b b' = forall f. Functor f => RefFamily f a a' b b'Source
type Lens a b = LensFamily a a b bSource