-
Notifications
You must be signed in to change notification settings - Fork 696
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
Syntax for setting option to no value in ~/.cabal/config #1053
Comments
This is not that difficult to add if we agree on what the syntax should be for such options. My suggestion: What do others think? |
My suggestions:
|
I like $DEFAULT or something that makes it clear what value is being used. @dcoutts thoughts? |
I'd really like to extend this to all option types, but it's not obvious how to do it - we don't know what the default value is in all cases. |
We need to define what we mean by default value. Are they the values defined in Perhaps we're going about this wrong, if we're only trying to allow users to say that they want parallel builds by default perhaps we should add If we add |
There are two issues here:
Let's decide whether we want 1 first, and then what to do about 2. |
For
Defaulting to To sum up: extending other option types to support |
So does If we just do |
It depends on the value given to |
One (half-baked) idea for a solution: add a right zero to the
where
This way, |
This is no longer a monoid though, as
violates the identity law. You need two separate monoids if you want two identities. We could perhaps achieve the affect we want by wrapping one monoid in another. I would like @dcoutts opinion before we do something more invasive like this (and hence I suggested the |
Please correct me if I'm wrong, but that would be the case if
Agreed. It's just an idea. |
This does violate the identity law, however:
Should be changed to
|
My apologies. I guess it doesn't really make sense to talk about the monoid laws at all here, as this is not a monoid (which can only have one identity). |
Looks like it is called a monoid with a right absorbing element: |
See #1142 for a simple solution. The semantic problem is that --blah lets you have an extra value compared to what you can specify with --blah=X. If we don't allow that, then it's all fine. That is, we say that --blah must be expressible in terms of --blah=X for some X. The reason it's a problem is that |
We're doing this: 9926424 |
cabal install -j
uses the available cores, figuring it out automatically, but in~/.cabal/config
you have to give it a number explicitly.The text was updated successfully, but these errors were encountered: