Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

NFData instances? #283

Closed
gregwebs opened this issue Apr 22, 2016 · 9 comments
Closed

NFData instances? #283

gregwebs opened this issue Apr 22, 2016 · 9 comments
Assignees

Comments

@gregwebs
Copy link

I wanted to put a retry around sending a request to AWS. Unfortunately there are no NFData instances, so it is difficult for me to confidently trap an exception.

Is it possible to automatically generate NFData instances for everything?

@brendanhay
Copy link
Owner

Sure is. Been meaning to add them for a while, so I'll do it sometime over the weekend.

@brendanhay brendanhay self-assigned this Apr 22, 2016
brendanhay added a commit that referenced this issue Apr 28, 2016
@brendanhay
Copy link
Owner

brendanhay commented Apr 28, 2016

Unfortunately due to the use of conduit for some request/response types, NFData instances cannot be provided. I've attempted to generate them wherever else possible.

@brendanhay
Copy link
Owner

Let me know if this will cover your use case @gregwebs, and I'll look at cutting a release pending some other minor changes + CI.

brendanhay added a commit that referenced this issue May 3, 2016
brendanhay added a commit that referenced this issue May 3, 2016
brendanhay added a commit that referenced this issue May 3, 2016
brendanhay added a commit that referenced this issue May 3, 2016
@gregwebs
Copy link
Author

gregwebs commented May 3, 2016

Seems like a great improvement. However, I still have many responses without instances. some of which seem like they shouldn't have anything to do with conduits.

  • SetDesiredCapacityResponse
  • TerminateInstancesResponse
  • DescribeSpotPriceHistoryResponse
  • DetachInstancesResponse

@gregwebs
Copy link
Author

gregwebs commented May 3, 2016

Note that I cannot generate instances myself because smart constructors and exported instead of the data constructors.

@brendanhay
Copy link
Owner

Thanks for catching that, an error on my part. d75a122 adds the expected response instances.

Does your latter comment imply you'd rather see fully exported types?

@gregwebs
Copy link
Author

gregwebs commented May 3, 2016

That's better!

This satisfies my only current use case for fully exported types. In general it can be nice to expose them at least from an Internal module so that a user can create instances.

@brendanhay
Copy link
Owner

I ask because it's not that I haven't exported them out of some misguided principle, it just requires some work to ensure that the .Internal style modules are generated - or that there isn't an additionally overwhelming amount of exports/imports (also Haddock) happening. I'll look into doing it as a somewhat low priority.

@brendanhay
Copy link
Owner

The NFData instances are available in 1.4.1 on Hackage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants