
On Fri, Aug 22, 2014 at 12:49 PM, Bram Neijt
Can I easily depend on the dependencies of another package or should I create a library and depend on that in my test and executable?
There's no way to do what you're trying to do without putting your functionality into a library. Cabal then has a feature that allows you to depend on the library in your executables and test suites. Then you don't repeat your library dependencies in your executables and test suites. This feature has, however, some unresolved bugs: https://github.com/haskell/cabal/issues/1919 so I wouldn't recommend its use unless you are willing to deal with some bugs. I would just gulp and deal with the duplication in your Cabal file (and the longer compile times) or, alternatively, adopt a tool to deal directly with the problem of duplication, such as: https://hackage.haskell.org/package/cartel But a tool like Cartel does nothing about compile times. If compile times are really a concern, I would just put the library in a completely separate package and package the executables and tests separately.