-
Notifications
You must be signed in to change notification settings - Fork 841
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
Use less permissive types in the config monoids #2267
Comments
Agreed, do you want to submit a PR for this? |
Yes I've already started to work on this. One thing that would be useful for this, are |
I suppose I wouldn't mind including instances for |
Great! I'll make a PR. |
Here are some necessary ingredients to achieve what you'd like for e.g.
It may eventually be a nice idea to include such an optparse combinator in the path package itself eventually, but for now it can be put in Do you have everything you need? ☝️ 😄 |
Thanks! :) I'll ask if need anything else! |
I'd like to use better types in
|
Possibly uri-bytestring? |
Thanks, I didn't known about that one. One downside here is that it will accept any scheme, not just I see that we later usually call I've also come across path-extra and urlpath but these don't seem to have any parsing utilities. I guess I'll just make a newtype of |
I did that (this is pre-http-client-0.5) but I wasn't so happy with the result. (Can't really put my finger on what exactly though) Now I'm thinking of something like this:
I believe this would fit the need of I'm probably overthinking this. If someone feels like bikeshedding this, please help! ;) |
…oids Use less permissive types in the config monoids (#2267)
Coming from Java, I'd add Also, your |
I've looked at your code and frankly it mostly LGTM. |
ConfigMonoid
(and probably other config monoids too) contains a few fields that have more permissive types than necessary. This has the effect that bad inputs go undetected or result in errors that are reported out of context or only after the inputs have been passed to ghc.A few of the problematic fields:
configMonoidWorkDir
configMonoidOs
configMonoidExtraIncludeDirs
Example interaction:
Compare this to the error message for an argument that must be a
Path Abs Dir
:The text was updated successfully, but these errors were encountered: