Given a set of cabal packages, is there a way to automatically calculate subset of independent packages? In other words, subset of packages that will be sufficient to install them all.
For [network,parsec]
the answer is [network]
because it network
depends on parsec
.
For [network,containers]
the answer is [network,containers]
because:
network
does not depend on containers
network
s dependencies not depends on containers
containers
does not depend on network
containers
s dependencies not depends on network
It's not hard to find the answer for 2 packages. What is really interesting is to find out independent set for [containers, directory, filepath, lens, xml, http-conduit, regex-posix, monad-control, unordered-containers, glib, hashable, hspec, split, aeson, attoparsec, stm, QuickCheck]
.
From answer I expect some function based on cabal library like ∷ [Packages] → IO [Packages]
.
Cabal is moving to a more NPM-like model, which will make dependency resolution much simpler. Each installed package will keep a local copy of its dependencies, trading a little disk space for the headache of installing multiple global packages with mutually exclusive package versioning demands.
Under this model, the subset of packages required to install a set of packages ==
that set. Though one may be a dependency of the other, each installed copy will keep its own local copy of its dependencies, so Cabal won't consider the dependency installed that way any more.
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