Is there a way to use Cabal to keep Haskell packages up-to-date?

浪子不回头ぞ 提交于 2019-12-09 12:38:52

问题


I'm confused by how Cabal works. I'm used to packages managers that have as part of their core functionality the ability to easily update all packages that have changed, or at least to get a list of packages on my system that have updates available. But Cabal seems to lack this functionality. Am I missing something?

Is there a way to:

  1. Automatically or easily update all out-of-date packages; or, failing that,
  2. Get a list of packages installed on my system that have updates available?

回答1:


There are a number of standard package-management features missing from cabal. This is one of them, and (transitive) removal of packages is another. The party line is that cabal is intended to be an automatic build tool, nothing more; though that line grows thinner and thinner as the years drag on.

If you know which packages you want to upgrade, you can; generally cabal update and cabal install those packages will grab the newest package list from Hackage and try to find an install plan that installs the newest versions of the requested packages. You can ask for the install plan without executing it with cabal install --dry-run those packages; if it doesn't look like it picked the versions you want, you can add constraints, as in

cabal install those packages --constraint 'those>=9000'


来源:https://stackoverflow.com/questions/32077856/is-there-a-way-to-use-cabal-to-keep-haskell-packages-up-to-date

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!