-
Notifications
You must be signed in to change notification settings - Fork 843
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
Consider if other order of combination is more appropriate for the monoids on config types #2078
Comments
I've been wondering why we don't use newtype wrappers like The upside would be reduced code size and obvious semantics. Am I missing something? |
That makes sense to me! I think maybe it's explicit so that we can easily add more complicated monoid logic. It could even be good to enforce that the monoid behaves in a more isolated fashion, where each field can be considered independently |
Here's a tiny sample converting |
Nice, works well for that! |
Working on #2095 I came across some more funky
Here I'm just surprised that all fields except Maybe |
For the The I'm in favor of flipping the monoid around for |
Thanks for the explanation! Would you mind if I change the instance to highlight that invariant?
|
Sure! Now we'll see if my reasoning holds at runtime :) |
Many of the fields use
configField l <|> configField r
. This means the value on the left overrides the value on the right. I noticed that this isn't uniformly followed. For example,I would expect the order to be the opposite here, since ghc-options later in the list override earlier options. These definitions should be considered more carefully.
For now, in working on #863, I am sticking with the same semantics as before. So, if this gets changed, that should also get modified.
The text was updated successfully, but these errors were encountered: