Is there an equivalent of makeLenses
for GADTs? If I have a simple GADT
like:
data D a b where
D :: (Ord a, Ord b) => !a -> !b -> D a b
Is there a way to generate lenses automatically by passing in a constructor and a list of field names?
Is there an equivalent of makeLenses
for GADTs? If I have a simple GADT
like:
data D a b where
D :: (Ord a, Ord b) => !a -> !b -> D a b
Is there a way to generate lenses automatically by passing in a constructor and a list of field names?
I don't think it can be done automatically, but writing some lenses by hand isn't that hard in this particular case:
There seems to be a somewhat relevant GitHub issue, in which Kmett claims they cannot create lenses for existentially quantified fields.