I'm quite new to the Haskell stack, so I might be misunderstanding how things are intended to work here, but I have a problem that I've seen a few times and am wondering if I'm going about the wrong way.
In short, I sometimes want to use a package with a version spec that is capped at a lower version of base
than what my Stack resolver includes.
For example, I can't use the lts-12.14
resolver with PSQueue-1.1
, because the former includes base-4.11.1
and the latter requires base >=4 && <4.11
.
The two ways I have found to resolve that has been to either
base
to my extra-deps
, making sure that the pinned version is within the range my package allows; orbase
)Both of these feel suboptimal, especially since I might want to use packages which have non-overlapping ranges (e.g. one >=3 && <4.11
and one >=4.11
). I realize that using such a combination toghether might fail, especially if they are locked on different major-versions of base
(assuming base
uses semver), but so far I'm only writing pretty small programs, so if they seem to work I'm quite happy even if there are other, non-exercised code paths that will fail on the specific combination of packages and versions. In other words: I know the risk - but I can't chance it, because I don't know how to.
Is there a way to force Stack to allow a newer version of base
than the one specified in the requirements of a dependency?
I think you are looking for allow-newer
- https://docs.haskellstack.org/en/stable/yaml_configuration/#allow-newer
Ignore version bounds in .cabal files. Default is false.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With