Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Independent subset of cabal packages set

Tags:

haskell

cabal

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
  • all networks dependencies not depends on containers
  • containers does not depend on network
  • all containerss 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].

like image 205
ДМИТРИЙ МАЛИКОВ Avatar asked Mar 03 '13 14:03

ДМИТРИЙ МАЛИКОВ


1 Answers

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.

like image 67
mcandre Avatar answered Nov 07 '22 10:11

mcandre