Conversation
elif in Cabal fileselif in Cabal files
sol
left a comment
There was a problem hiding this comment.
This whole HasEmpty construction is not particularly beautiful.
I think what I would try is either
- try to transform nested conditionals into
elifs at parsing time
or instead
- focus on some general solution to avoid staircases in
package.yaml(as we started discussing in #604)
(or maybe even do both)
| else | ||
| hs-source-dirs: | ||
| unsupported-os | ||
|
|
There was a problem hiding this comment.
I don't think that this is relevant user documentation. Nested if-statements and elif are semantically equivalent. As I understand it, this is a purely cosmetic change.
I say, either remove this completely, or add a separate section that describes how .cabal files are formatted. This section could then also include what I mentioned here: #606 (comment)
| uses "RebindableSyntax" | ||
| && (uses "OverloadedStrings" || uses "OverloadedLists") | ||
| && pathsModule `elem` getMentionedModules sect) | ||
| , makeVersion [2,2] <$ guard (sectionSatisfies (isJust . maybeSectionAConditional) sect) |
There was a problem hiding this comment.
What this is saying is that if a nested conditional can be transformed into an elif, then require Cabal 2.2.
What I think you would want to do is the other way around: If the rendered .cabal file has cabal-version: 2.2 (or later) then produce elifs.
See:
elifin Cabal files #604