Copyright | (C) 2012-16 Edward Kmett (C) 2018 Well-Typed LLP |
---|---|
Safe Haskell | None |
Language | Haskell2010 |
Note: GHC.Generics exports a number of names that collide with Optics (at least to
).
You can use hiding or imports to mitigate this to an extent, and the following imports, represent a fair compromise for user code:
import Optics import GHC.Generics hiding (to)
You can use generic
to replace from
and to
from GHC.Generics.
Synopsis
- generic :: Generic a => Iso' a (Rep a b)
- generic1 :: Generic1 f => Iso' (f a) (Rep1 f a)
- _V1 :: Lens (V1 s) (V1 t) a b
- _U1 :: Iso (U1 p) (U1 q) () ()
- _Par1 :: Iso (Par1 p) (Par1 q) p q
- _Rec1 :: Iso (Rec1 f p) (Rec1 g q) (f p) (g q)
- _K1 :: Iso (K1 i c p) (K1 j d q) c d
- _M1 :: Iso (M1 i c f p) (M1 j d g q) (f p) (g q)
- _L1 :: Prism' ((f :+: g) a) (f a)
- _R1 :: Prism' ((f :+: g) a) (g a)
- _1 :: Lens' ((f :*: g) a) (f a)
- _2 :: Lens' ((f :*: g) a) (g a)