[Haskell-cafe] Maintaining test-suite dependencies with cabal

Mateusz Kowalczyk fuuzetsu at fuuzetsu.co.uk
Fri Aug 22 17:45:37 UTC 2014

On 08/22/2014 06:03 PM, Tobias Dammers wrote:
> I have found that splitting functionality off into a library is way too
> useful for a lot of things anyway, so I'd just do that.
> On Aug 22, 2014 6:49 PM, "Bram Neijt" <bneijt at gmail.com> wrote:
>> Dear reader,
>> I have a single executable package in Cabal[1] and I have added a test
>> for it using an example configuration from the ltc package[2].
>> With my test on my executable I can't depend on the main package, but
>> I seem to have to repeat the dependencies of my executable, or split
>> off functionality into a library. [3]
>> 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?
>> All source is at: https://github.com/bneijt/after/
>> Greetings,
>> Bram
>> [snip]

+1 to this, just stick it into a library section. You can even have your
executable be just ‘main = realMain’ and everything else (including
realMain) in the library.

There's a benefit of someone being able to come along and go ‘hey, this
program does these useful things, I sure could use some of them for my
own program’ which is great.

Mateusz K.

More information about the Haskell-Cafe mailing list