It doesn't do anything special. The generated lens is named type
and funnily enough, GHC appears to be totally cool with this. You can even use it if you use the fully qualified name:
{-# LANGUAGE TemplateHaskell #-}
module Foo where
import Control.Lens
data Bar = Bar { _type :: String }
deriving Show
$(makeLenses ''Bar)
> :l Foo
> :t type -- Um...
<interactive>:1:1: parse error on input `type'
> :t Foo.type -- Haha!
Foo.type
:: (Functor f, Profunctor p) =>
p String (f String) -> p Bar (f Bar)
> Bar "hello" ^. Foo.type
"hello"