How does stack resolve dependecy conflicts?
I just started off with Haskell and I have few questions on how stack resolves dependencies.
Let's say my project requires
lib Aandlib B.Internally,
lib Arequireslib X-1.9.0andlib Brequireslib X-2.0.0, how would stack resolve this?stack documentation says they use snapshots to resolve conflicts, how does that work? Does it mean authors of lib A and lib B decide on a version of lib X which works with both of them? If so, what happens when I use a newer version of lib A or lib B or if either of them are not in the snapshots?
How are snapshots actually made?
Stack by default installs packages globally. What happens when a Project A requires lib Y-1.0 and Project B requries lib Y-1.1? How does this gets taken care of?
How does one use packages at "stackage.org"?
I was trying to install
beam-coreand google took me to https://www.stackage.org/package/beam-core where there's no mention of the command which installs it or what is the latest version. I could not find the version number anywhere expect in github releases.With both pip and npm, it's quite straight forward and all the information on how to install and use is available on package's page. For example both,
https://pypi.org/project/bencode.py/
https://www.npmjs.com/package/projects
contains version number and install command, even though they are quite obvious.
I often get errors related to 'stack-configuration' when I try to install a package. I don't what 'stack-configuration' is? What does all these errors mean and how to resolve them in context with all the above questions?
Performing stack install beam-core or stack repl --package beam-core --package beam-sqlite --package sqlite-simple --package beam-migrate --package text results in
`Users/username/Documents/beam-learn/beam-learn.cabal was modified manually. Ignoring /Users/username/Documents/beam-learn/package.yaml in favor of the cabal file.
If you want to use the package.yaml file instead of the cabal file,
then please delete the cabal file.
Stack has not been tested with GHC versions above 8.6, and using 8.8.2, this may fail
Stack has not been tested with Cabal versions above 2.4, but version 3.0.1.0 was found, this may fail
Error: While constructing the build plan, the following exceptions were encountered:
In the dependencies for hashable-1.2.7.0:
base-4.13.0.0 from stack configuration does not match >=4.4 && <4.13 (latest matching version is 4.12.0.0)
needed due to beam-core-0.8.1.0 -> hashable-1.2.7.0
Some different approaches to resolving this:
* Set 'allow-newer: true' in /Users/username/.stack/config.yaml to ignore all version constraints and build anyway.
* Build requires unattainable version of base. Since base is a part of GHC, you most likely need to use a different GHC version with the matching base.
Plan construction failed.`