generic-lens-lite-0.1: Monomorphic field lens like with generic-lens

Safe HaskellSafe
LanguageHaskell2010

Data.Generics.Lens.Lite

Description

Derive record field lenses generically.

Synopsis

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.

class HasField (name :: Symbol) r a | name r -> a Source #

Type-class restricting field usage.

Minimal complete definition

field__

Instances
HasFieldInternal name r a => HasField name r a Source # 
Instance details

Defined in Data.Generics.Lens.Lite

Methods

field__ :: Proxy name -> LensLikeYoneda' f r a