-
-
Notifications
You must be signed in to change notification settings - Fork 412
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
Servant.Links.addQueryParam not exported? #1232
Comments
I don't see a reason for it not to be exported. Please make a PR. |
Any chance that it could make the concept of safe links unsafe? |
There's a balance between being extensible, vs. preventing from programming errors. Maybe @alpmestan opinions? |
We've usually tried to keep things extensible whenever/wherever appropriate, and I think we definitely want to allow users to hook their own combinators in the link making machinery. I don't think that really makes our links less type safe. The only way to get them wrong is to make a mistake in an instance or do something bad with them, explicitly, after the link making function handed us correct ones. In the first case, well, it's easy to spot with some tests, and the code for those instances is fairly easy to follow. In the second, well it should be obvious where the problem comes from. Finally, if people have to get those functions from => I'm all for exporting those utilities from somewhere, especially if that somewhere makes it obvious that it's not the public API that users who just want to produce links need. |
I just bumped into this problem as well. IMO |
A PR is still welcome :-) |
I hit this again, while solving #1784 for my own codebase... I think I'll raise a PR now if no one has any objections 😄 |
I was trying to write a
ToLink
instance for a custom combinator calledAllQueryParams
(that captures all query parameters). Unfortunately, it seems almost impossible without resorting to type-level magic, because neither are the constructors ofLink
exported, nor isaddQueryParams
exported.Is there an obvious way of doing this, which I might be missing?
Here's my (non-working) code snippet:
The text was updated successfully, but these errors were encountered: