Convert from the data type to its representation (or back)
"hello"^.generic.from generic :: String"hello"
:: a typeCtrl KGHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05
Modulelens-5.3.5Haskell2010
You can use hiding or imports to mitigate this to an extent, and the following imports, represent a fair compromise for user code:
import Control.Lens hiding (Rep)
import GHC.Generics hiding (from, to)You can use generic to replace from and to from GHC.Generics,
and probably won't be explicitly referencing Control.Lens.Representable.Rep from Control.Lens
in code that uses generics.
This module provides compatibility with older GHC versions by using the generic-deriving package.
Convert from the data type to its representation (or back)
"hello"^.generic.from generic :: String"hello"
Convert from the data type to its representation (or back)