
On 10/07/2015 02:02 PM, Taru Karttunen wrote:
Instead of using #ifdef to handle four different compilers, keep a branch for each. Git is designed to make this easy, and it's usually trivial to merge changes from the master branch back into e.g. the ghc-7.8 branch. That way the code in your master branch stays clean. When you want to stop supporting an old GHC, delete that branch.
Isn't this hard to do correctly for libraries with Hackage and Cabal and narrowly versioned dependencies and deep import graphs?
It can be...
E.g. when adding a new feature to the library and merging it back to the ghc-7.8 branch the versions needed for features vs compiler support could end up causing complex dependency clauses for users of such libraries.
but can you think of an example where you don't have the same problem with #ifdef? If I need to use a new version of libfoo and the new libfoo only supports ghc-7.10, then I'm screwed either way right?