-
Notifications
You must be signed in to change notification settings - Fork 345
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
Systematically use WithDefault for PragmaOptions #6556
Conversation
7803655
to
b1bbae6
Compare
48ffe97
to
1ca23a3
Compare
badbe85
to
7d008d7
Compare
This is mostly a refactoring, but complements the "no-" case for many options that did not have it explicitly. Goal is to have a "no-" version for all boolean options, but atm some flags have side effects and checks.
Unfortunatly, the default setting must still be 'True' or 'False' rather that the 'true' or 'false' of the 'Boolean' class, since this class does not lift naively to the type-level. Maybe we can figure out to write e.g. WithDefault' UnicodeOrAscii 'UnicodeOk or even WithDefault 'UnicodeOk instead of now WithDefault' UnicodeOrAscii 'True Main obstacle is that we have to generalize `KnownBool (b :: Bool)` to `KnownBoolean a (b :: a)` but that would require extra boilerplate, like duplicating `Agda.Utils.TypeLits` for each 'Boolean' type. Ideally, one would state the iso between on `Bool` and `a` (where `IsBool a`) only once in the `IsBool` instance, not again on the type level... Left for future work / needs research.
Use generalized `WithDefault' a b` for `IsBool a` types. Generalized `pragmaFlag` to `pragmaFlag'` to handle flags with side effects like `--no-unicode`.
`--exact-split` also controls `-WCoverageNoExactSplit`. This now happens in the post-processing (`checkPragmaOptions`). Ideally, we would not have _two_ mechanisms for this option. Amended: got rid of Set.alterF
Amended: got rid of Set.alterF
@andreasabel, you changed some options so that activation of "option X that only makes sense together with option Y" now implies activation of "option Y". Is this a good idea? It can lead to less typing, but one could also argue that it is more clear if certain options always have to be declared. Currently some options are treated in this way, while others are not. For instance, |
I think if option X is "Y with additional features" then X should imply Y, rather than explicitly require Y. For the "erasure family" of options in particular, since these have "erase" already in the name. It is a bit like in a restaurant, where you can order a beer but also just a glass, but the order of a beer will imply the order of a glass... ;-) Meaning to say that I expect from a tool some common sense (as far as possible).
|
Well, agda/src/full/Agda/Interaction/Options/Base.hs Lines 1254 to 1265 in b673c46
agda/src/full/Agda/Interaction/Options/Base.hs Lines 1270 to 1290 in b673c46
|
Ok, I haven't looked at the without-K/cubical family in this PR. Just for the record, {-# OPTIONS --without-K --erased-matches #-}
foo : (@0 A : Set) (x : A) → A
foo A x = x
PR: |
flag b = NoArg $ effect a . set field a | ||
where a = fromBool b | ||
def b = applyWhen (fromBool b == b0) (++ " (default)") | ||
expl b = if b then unwords [pos, info] else fromMaybe ("do not " ++ pos) neg |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed this unwords
(case null info
) by bd4f880
In this PR:
pragmaFlag
method and theWithDefault
type--flat-split
implies--cohesion
; rather than implementing this as a side effect of--flat-split
, we includeoptFlatSplit
as disjunctive component inoptCohesion
; thus--flat-split --no-flat-split
will not turn on--cohesion
--exact-split
is now synonym of-WCoverageNoExactSplit
--count-clusters
is now on by defaultAlso: closes #6573, closes #6574.
--erasure
in--erase-record-parameters
comes too early #6573--exact-split
vs.-WCoverageNoExactSplit
#6574