Closed RyanGlScott closed 5 years ago
Resolved by 80eac5c
I'm assuming that https://github.com/ekmett/lens/issues/866#issuecomment-501182014 is your way of saying "I approve of #867" :)
Accordingly, I've just landed #867, so the aforementioned commit is now ced2f82d98863a6a5cf566808478c8035cfb97ac.
While investigating #865, I noticed something fishy about the code that
makeClassyPrisms
generates for data types with exactly one constructor. Here is a GHCi session which illustrates the issue:As GHC observes, the
_ -> Left x_a8H6
case is completely unnecessary. It shouldn't be too hard to arrange the TH machinery not to generate this, at least in the simple case where a data type only has one constructor. (One could imagine dropping the catch-all case for certain GADTs as well, but that seems more difficult to achieve.)