Safe Haskell | Safe-Infered |
---|

Provides all lens-related functions.

- lensWith :: (s -> a) -> (s -> a -> b -> t) -> Lens s t a b
- lensFieldName :: String -> String
- makeCustomLensesFiltered :: (String -> Bool) -> Name -> Q [Dec]
- makeCustomLenses :: Name -> Q [Dec]
- makeCustomLenses' :: Name -> [Name] -> Q [Dec]
- traverseOf2 :: Over (->) (Compose f g) s t a b -> (a -> f (g b)) -> s -> f (g t)
- mapMOf2 :: Over (->) (Compose (WrappedMonad m) g) s t a b -> (a -> m (g b)) -> s -> m (g t)
- atSet :: Ord a => a -> Lens' (Set a) Bool

# Documentation

lensWith :: (s -> a) -> (s -> a -> b -> t) -> Lens s t a bSource

Creates an optimized lens where the setter also gets the original value from the getter.

lensFieldName :: String -> StringSource

makeCustomLensesFiltered :: (String -> Bool) -> Name -> Q [Dec]Source

makeCustomLenses :: Name -> Q [Dec]Source

Create lenses for all fields of a given data type.

makeCustomLenses' :: Name -> [Name] -> Q [Dec]Source

Create lenses for some fields of a given data type.

traverseOf2 :: Over (->) (Compose f g) s t a b -> (a -> f (g b)) -> s -> f (g t)Source

Traverses over a composition of two functors.
Most often the `g`

functor is `(,) r`

and `traverseOf2`

is used to
traverse an effectful computation that also returns an additional output
value.

mapMOf2 :: Over (->) (Compose (WrappedMonad m) g) s t a b -> (a -> m (g b)) -> s -> m (g t)Source

Traverses over a composition of a monad and a functor.
See `traverseOf2`

.