generic-lens-0.3.0.1: Generic data-structure operations exposed as lenses.

Copyright(C) 2017 Csongor Kiss
LicenseBSD3
MaintainerCsongor Kiss <kiss.csongor.kiss@gmail.com>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellSafe
LanguageHaskell2010

Data.Generics.Product.Any

Contents

Description

Derive a variety of lenses generically.

Synopsis

Lenses

class HasAny sel a s | s sel k -> a where Source #

Records that have generic lenses.

Minimal complete definition

the

Methods

the :: Lens' s a Source #

A lens that focuses on a part of a product as identified by some selector. Currently supported selectors are field names, positions and unique types. Compatible with the lens package's Lens type.

>>> human ^. the @Int
50
>>> human ^. the @"name"
"Tunyasz"
>>> human ^. the @3
"London"

Instances

HasPosition i a s => HasAny Nat i a s Source # 

Methods

the :: Lens' s s Source #

HasField field a s => HasAny Symbol field a s Source # 

Methods

the :: Lens' s s Source #

HasType a s => HasAny * a a s Source # 

Methods

the :: Lens' s s Source #