-
Notifications
You must be signed in to change notification settings - Fork 370
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
Add an options data structure to allow fine-tuned control of what instances are generated for a route #1819
Add an options data structure to allow fine-tuned control of what instances are generated for a route #1819
Conversation
830184a
to
81abb89
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So that's going to be a breaking change for any library user that uses the Read
instance of the type
To avoid a major breaking change, we need to keep the default behavior of deriving Read
, but provide an option for the user to disable Read
derivation.
I can try to work on that. How would you want this configurable? I can make a mkRouteConsOpt that requires a config data structure, which has three booleans: |
I'm not terribly particular. I think @snoyberg mentioned using a directive in the actual routes file would be fine - maybe something like:
as a very quick, patch-level fix. Defining an |
Are there other examples of such directives? I'm looking at the parser and I'm not sure whether there are other directives, and I don't necessarily want to rewrite this parser. |
…es are derived for a Route
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR looks great, thank you! I made some suggestions for the version number + @since
comments.
c316ee2
to
dc346a7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Thank you 😄
Is anything else needed for merging? |
CI failures look spurious. I'll merge now. @snoyberg I don't have maintainer rights on Hackage for |
@parsonsmatt absolutely, I'd be happy to. What's your Hackage username? |
It's |
@parsonsmatt I've given you maintainer rights on Hackage for yesod-core and a bunch of other Yesod packages too. If you need any more, just let me know. Thank you! |
Before submitting your PR, check that you've:
@since
declarations to the Haddocks for new, public APIsAfter submitting your PR: