-
Notifications
You must be signed in to change notification settings - Fork 711
implicit common stanzas (a.k.a. common blocks) #5530
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
Comments
Have you seen the original design discussion at #2832 ? The idea of implicit common blocks was anticipated there already |
afaik cabal already supports common stanzas, which can include common dependencies, so this could be closed? |
this issue is different, it's about a common stanzas enhancement that would reduce import bolerplate and it looks like the proposed extension in #2832:
wasn't implemented, nor was the proposed unnamed stanza. I'm not sure why is that. @phadej @hvr was there a reason for it? |
Oh sorry, i missed the implicit part. |
It would be nice to be able to avoid writing the same imports everywhere - this becomes relevant as backpack encourages many internal libraries with similar cabal properties.
The most general way I can imagine is common import blocks that would look something like
where each piece within the indented scope implicitly imports
my-common
.another possibility with even less boilerplate at the cost of being less general is to have toplevel implicit imports like
so that all libraries import it. There'd also be similar constructs for executable, test-suite, benchmark, foreign-library, etc.
The text was updated successfully, but these errors were encountered: