I'm trying to make lenses for a slightly complex GADT, and finding it doesn't want to generate one for one of my constructors. The code looks like this:
{-# LANGUAGE GADTs, RankNTypes, TemplateHaskell, KindSignatures, DataKinds #-}
import Control.Lens
import GHC.TypeNats
data Variant (m :: Nat) where
VariantA :: Variant 42
data Stuff where
Foo :: { _foo :: Int } -> Stuff
Bar :: forall t. { _bar :: String } -> Stuff
Baz :: forall m. { _baz :: Variant m } -> Stuff
$(makeLenses ''Stuff)
I find that this generates lenses foo and bar, but not baz. It seems to be something to do with the constraint on baz and the kind signature Variant m. Why can't I get a lens for baz?
I saw that some support for existentially quantified record constructors was added at the end of https://github.com/ekmett/lens/issues/409, but wondering if this is a further lens issue.