Can containers depend on Template Haskell?

Henning Thielemann schlepptop at
Sun Dec 5 00:25:40 CET 2010

Mark Lentczner schrieb:
> On Dec 4, 2010, at 3:07 AM, Henning Thielemann wrote:
>> That's not possible - a package at a specific version must export the
>> same API independent of the compiler, operating system and so on.
> I agree that that is desirable, but I don't understand why it is a "must". I can easily imagine packages where, one or two extra functions are available depending on the arch, os, or compiler version. We currently have the functionality in cabal and GHC to have conditional compilation based on such factors. So, we should recognize that it is possible, and at times, a reasonable design compromise. Or at the very least, even if we believe it is a bad design choice, we should recognize that other library developers may think otherwise.

How can I safely import a package A with a specific version, if it
exports different APIs according to a bunch of other conditions? I have
to copy all those conditions from A.cabal into my own cabal file, even
more the conditions of all such packages with an API that depends on
more than the version.

This is really a FAQ, but I cannot find earlier discussion easily.

More information about the Libraries mailing list