Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Deriving clauses of Ptr are not calculated correctly #888

Open
1 of 6 tasks
endgame opened this issue Jan 17, 2023 · 1 comment
Open
1 of 6 tasks

Deriving clauses of Ptr are not calculated correctly #888

endgame opened this issue Jan 17, 2023 · 1 comment

Comments

@endgame
Copy link
Collaborator

endgame commented Jan 17, 2023

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

  • Configuration contains ConfigurationList and a Sensitive field.
  • ConfigurationList contains Configuration

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 — endgame@bdcba74 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:

  • Build out a botocore library which is a direct representation of the data files provided by AWS - service, paginators, waiters, and the new endpoint-rule-set type.
  • Add some sort of "JSON deep-merge" functionality to botocore to support the splicing in of annexes.
  • Rewrite the generator to read from botocore types
  • Rewrite the generator to use botocore, and differentiate each stage (classifying shapes; applying renames/overrides; generating code)
  • Consider a more modern lib than haskell-src-exts for code generation (maybe ghc-exactprint?)
  • Kill the cofree comonad of shapes once and for all. it was a defensible idea when the inclusion graph of shape definitions was a DAG, but that has not been true for a very long time. If every shape reference is handled as if it were a Ptr by looking it up in a MonadReader context, edge cases like this will stop happening.
@endgame
Copy link
Collaborator Author

endgame commented Jun 27, 2023

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

@endgame endgame added this to the 2.0 milestone Jun 30, 2023
@endgame endgame mentioned this issue Jun 30, 2023
@endgame endgame removed this from the 2.0 milestone Jul 10, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

1 participant