[Haskell-cafe] [Haskell-community] technical thoughts on stack
Edward Z. Yang
ezyang at mit.edu
Thu Sep 15 14:23:41 UTC 2016
Excerpts from Harendra Kumar's message of 2016-09-15 13:02:50 +0530:
> While I agree that stack.yaml is a frozen config, we do not necessarily
> need a separate config file or a separate format for that. My main point
> was a that a new user will have to understand two more languages
> (YAML/cabal) in addition to Haskell. We can have the config spread in
> multiple files, but they should look like an extension of the same thing
> rather than disparate things.
For what it's worth, cabal.project files use the same parser/lexical
structure as Cabal files; the fields/stanzas are just different. I'm
not familiar with the reasons why Stack decided to use YAML for their
> The stack snapshot config can be seen as a higher level concept of the
> pvp-bounds in the cabal file. While pvp-bounds specifies a whole range, the
> snapshot is a point in that space. It can also be seen as a more general
> version of the "tested-with" field in the cabal file. We can instead say -
> tested-with these snapshots (or set of versions). Instead of using
> stack-7.8.yaml, stack-8.0.yaml manually, the build tool itself can list
> which snapshot configs that are available and you can choose which one you
> want to build. The config could be tool agnostic.
Well, if the "snapshot" config is put in specific file, there's no
reason why Cabal couldn't be taught to also read configuration from that
file. But if cabal-install wants it to be in "pkg description format"
and Stack wants it to be in YAML I'm not sure how you are going to get
the projects to agree on a shared format. Snapshot config is put
in cabal.project.freeze, which has the virtue of having the *same*
format of cabal.project.
More information about the Haskell-Cafe