MIN_VERSION_foo() macro vs. CABAL-flag directed API-adaption

Herbert Valerio Riedel hvr at gnu.org
Tue Sep 18 18:03:53 CEST 2012


Henning Thielemann <lemming at henning-thielemann.de> writes:

> I prefer the Cabal approach since it requires one (hacky) tool less in
> the tool chain. I use different Hs-Source-Dirs depending on a Cabal
> flag. With ghci you can choose the different modules using the -i
> option.

I see, but what about CABAL's version constraint solving algorithm: are
there situations, where using the flag-based approach (to switch between
disjunct version-ranges for a given dependency, thus requiring CABAL to
backtrack on flag-settings iirc) leads to an observably different
"solutions" than those which result when offering CABAL a contiguous
version-range (and defer the version-range "discontinuity" to the CPP
level)? Or are the two approaches "semantically" equivalent from the
CABAL version constraint-solving point-of-view?



More information about the Libraries mailing list