brendanhay / amazonka

A comprehensive Amazon Web Services SDK for Haskell.
https://amazonka.brendanhay.nz
Other
599 stars 227 forks source link

Deriving clauses of `Ptr` are not calculated correctly #888

Open endgame opened 1 year ago

endgame commented 1 year ago

In amazonka-emr-containers, there is the following set of mutually-recursive shapes:

Under #862 , the map of shapes was populated in such a way that ConfigurationList held a Ptr to Configuration, which meant that it generated a deriving clause containing a static set of class names, including Read. This fails to compile, as Configuration contains a Sensitive field, and so cannot have a Read instance.

The correct fix is to determine the set of deriving clauses by constraint solving — https://github.com/endgame/amazonka/commit/bdcba74b64d536d303be99cf9ecdd781766c770d was an attempt at this, but I am abandoning it after a week and a half because it's still broken. Supporting #872 will require a serious re-architecting of the generator anyway, so let's do it properly:

endgame commented 1 year ago

A possible workaround could be to allow the use of "underive" without "replace"?