
Yes, it's the classic diamond dependency graph. A / \ B C \ / D A = Trader, B = ProfitCalculator, C = Persistence, D = MarketModel. It is not that I *want* Trader (A) to depend on two different versions of MarketModel (D), that is just a consequence. I don't have a choice. What I want is for the ProfitCalculator (B) and Persistence (C) to always build. And if an update changes the MarketModel (D) from underneath them, they might break. So, I want them to each lock-in a specific version. In effect, I am forcing the graph above to turn into something like. A / \ B C / \ D D' I may not write any code that uses the MarketModel (D) directly on the Trader (A). I do understand that there are at least 1 point to keep in mind: types defined in D will be different from those in D' (typeclasses will be defined twice) But the benefit of *not* having to always keep everything building on the latest version every time I update the MarketModel (D) is huge for me! Cheers, Dimitri Em 10/09/15 06:50, timmy tofu escreveu:
Using the 'cabal sandbox add-source' solution now requires that I "add-source" the MarketModel package too. Otherwise, any change I make to this package will not be tracked.
then…
Cabal sets the paths for "import"ed modules in the "hs-source-dirs:" and that is global to the whole package.
I can't tell if you do or do not want ProfitCalculator and Persistence to track changes made in MarketModel.
If you do, and both should be in lock-step with it (unlike your situation with Tax), then you don't have a problem.
If not, then the problem is Trader would depend on ProfitCalculator which might depend on a different version of MarketModel than Persistence (upon which Trader also depends). That is a classic dependency problem and not a function of submodules or add-sourcing, per se. The Trader module seems to be at the top of this heap - why would you want the Trader to (indirectly) use one version of MarketModel through ProfitCalculator, and another through Persistence?
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe