Safe Haskell | Safe |
---|---|

Language | Haskell2010 |

Derive record field lenses generically.

# Documentation

field :: forall (name :: Symbol) (r :: Type) (a :: Type) (f :: Type -> Type). (HasField name r a, Functor f) => (a -> f a) -> r -> f r Source #

A lens that focuses on a field with a given name.
Compatible with the lens package's `Lens`

type.

**Note:** the lens is *simple*, i.e. doesn't allow type-changing updates.
This keeps the implementation small and quick.

You also may want to specify
```
{-# OPTIONS_GHC -funfolding-keeness-factor=100 #-} (or some other arbitrarily large number)
```

for GHC to inline more aggressively.