<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Aug 22, 2014 at 12:49 PM, Bram Neijt <span dir="ltr"><<a href="mailto:bneijt@gmail.com" target="_blank">bneijt@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
Can I easily depend on the dependencies of another package or should I<br>
create a library  and depend on that in my test and executable?<br>
<br></blockquote><div><br></div><div>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.<br>
<br></div><div>This feature has, however, some unresolved bugs:<br><br><a href="https://github.com/haskell/cabal/issues/1919">https://github.com/haskell/cabal/issues/1919</a><br><br></div><div>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:<br>
<br><a href="https://hackage.haskell.org/package/cartel">https://hackage.haskell.org/package/cartel</a><br><br></div><div>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.<br>
</div></div></div></div>