Looking to know whether there’s any way to go from
data Foo = …
deriving Generic
deriving Bar [via Quux Foo]
to
data Foo = …
instance Bar Foo where
…
without potentially introducing errors into the code.
Looking to know whether there’s any way to go from
data Foo = …
deriving Generic
deriving Bar [via Quux Foo]
to
data Foo = …
instance Bar Foo where
…
without potentially introducing errors into the code.
Does --ddump-derivs work? The code will still need inlining and eta expansion since HLS doesn’t yet support that, so it’ll probably be too complex but unroll manually.
Nope, you get the raw definitions, so either an empty instance that falls back to its Generics-based default, or (if DerivingVia) a coercion to an unlisted instance.