You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
YAML includes are inadequate for DRYing up even moderately-complex cabal config. Mostly due to the lack of recursive merge.
For instance, if I define a shared YAML file with default-extensions for my entire monorepo but a single package wants to add another default-extension just for itself, it clobbers the include. There's no good way around this using just YAML includes.
Now, if I could use cabal common stanzas, then YAML includes could help me:
I could define the common stanzas in shared YAML across my monorepo
My individual packages' package.yaml could include the common stanzas
Each package.yaml could then use cabal import accordingly.
I guess an alternative would be for hpack to add support for proper YAML recursive merge. But even if it had that, I don't see why hpack shouldn't support the cabal feature.
The text was updated successfully, but these errors were encountered:
That's so much needed. I've tried using hpack a few times, but always had to go back to using Cabal.
YAML's anchors are rarely enough. E.g. you can't use it with ghc-options, because this is a list and YAML doesn't support list concatenation. You can hack it like this (but that's very ugly):
I saw this #513
I'm opening a new issue about the same thing.
YAML includes are inadequate for DRYing up even moderately-complex cabal config. Mostly due to the lack of recursive merge.
For instance, if I define a shared YAML file with
default-extensions
for my entire monorepo but a single package wants to add anotherdefault-extension
just for itself, it clobbers theinclude
. There's no good way around this using just YAML includes.Now, if I could use cabal common stanzas, then YAML includes could help me:
package.yaml
couldinclude
the common stanzaspackage.yaml
could then use cabalimport
accordingly.I guess an alternative would be for
hpack
to add support for proper YAML recursive merge. But even if it had that, I don't see why hpack shouldn't support the cabal feature.The text was updated successfully, but these errors were encountered: