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 |
snoyberg
left a comment
There was a problem hiding this comment.
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
jezen
left a comment
There was a problem hiding this comment.
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.
## 1.7.9 * Added `checkboxesField'` for creating checkbox in more correct way than original `checkboxesField` Function `checkboxesField` marked as deprecated. [#1843](yesodweb/yesod#1843) ## 1.7.8 * Added `radioField'` for creating radio button in more correct way than original `radioField`. Function `radioField` marked as deprecated. [#1842](yesodweb/yesod#1842) ## 1.7.7 * Added `optionsFromList'` to create an OptionList from a List, using the PathPiece instance for the external value and a custom function for the user-facing value. Also added `optionsEnum'` to create an OptionList from an enumeration [#1828](yesodweb/yesod#1828)
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: