You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the moment, api-tools uses derived instances for its generated types, but does not specify the deriving strategy. This can lead to problems, in particular for newtypes when both DeriveAnyClass and GeneralizedNewtypeDeriving are enabled, because the choice of strategy is ambiguous. Ideally we would explicitly request newtypeStrategy to avoid this; although that might require the DerivingStrategies extension to be enabled in user code.
FWIW it looks like TH code can test which extensions are enabled, so it would be possible to do this in a backwards-compatible way: require DerivingStrategies only if DeriveAnyClass is enabled.
Activity
cdornan commentedon Aug 19, 2020
I agree — best to be explicit, even at the cost of requiring
DerivingStrategies.adamgundry commentedon Aug 19, 2020
FWIW it looks like TH code can test which extensions are enabled, so it would be possible to do this in a backwards-compatible way: require
DerivingStrategiesonly ifDeriveAnyClassis enabled.