-
Notifications
You must be signed in to change notification settings - Fork 374
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
Upstream helper functions to Yesod.Form.Option. #1828
Upstream helper functions to Yesod.Form.Option. #1828
Conversation
The 2 new functions are: - optionsFromList': creates an OptionList from a List, using the PathPiece instance for the external value and a custom function for the user-facing value. - optionsEnum': creates an OptionList from an enumeration. Also bump the version and update the changelog.
May I request a review from @snoyberg |
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.
This overall seems like a very specific solution, I'm not sure it belongs in the library.
I think these are quite generally useful — relying on If these functions are too specific for this library, perhaps they can go into some adjacent library, e.g., create a In any case, it isn't immediately obvious (especially to someone newer to Yesod) why they might use these functions, so I would like to see example usage documentation, similar to how it's done in the documentation for the |
@jezen more than happy to defer to you on the decision of inclusion |
- Add example usage to optionsFromList'. - Explain optionsEnum' using optionsFromList'. - Add @SInCE tags.
bf5d1ff
to
b1a3b53
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.
This is good — the examples are really clear. Thank you.
It'd be great to see automated tests, and haddocks for each of the function arguments, but let's go with this as-is for now.
The 2 new functions are:
Also bump the version and update the changelog.
Before submitting your PR, check that you've:
After submitting your PR: