-
Notifications
You must be signed in to change notification settings - Fork 15
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
Difficult to introduce fallbacks when parseQuality fails #20
Comments
Okay. I think I might actually just make the argument a string and reuse |
Are you ever building quality values that don't have a quality of 1? |
Re building non-1 quality values: I think it's possible. My current use-case can afford to be a toy, but I could easily see someone building a server that fills in a default accept header along the lines of |
Okay, I've pushed to develop. I've exposed the |
Totally forgot about this. Let me know if you have any thoughts, I'll push the release soon. |
Well, you're not alone in forgetting :) I think this kills the issue. I was going back-and-forth on whether an I did have an unrelated idea before you publish, which I've put in #21 for organization purposes. |
In #1, I suggested that some sort of
a -> Float -> Quality a
function was unnecessary, but now that I'm using this library more, I think that was a poor idea, mainly for this reason:Or in English, when there is no Accept header (or it's invalid), then I want to behave as if the client will accept anything. The code above is a workaround, but while I know the
fromJust
will work, I've developed a special enmity towards this particular partial function. It would be much better to replace(fromJust $ ...)
with something like("*/*" `q` 1)
(though probablyq
isn't the best name... but I'll let you sort that out).And, to answer the question from #1 about a fractional vs. integral argument, I think the fractional is the clearest. After all, if it's written
0.8
in the header, it may as well be written0.8
in Haskell.The text was updated successfully, but these errors were encountered: