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:
networkdoes not depend oncontainers- all
networks dependencies not depends oncontainers containersdoes not depend onnetwork- all
containerss dependencies not depends onnetwork
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].