<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Yes, it's the classic diamond dependency graph.<br>
A<br>
/ \<br>
B C<br>
\ /<br>
D<br>
<br>
A = Trader, B = ProfitCalculator, C = Persistence, D = MarketModel.<br>
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.<br>
<br>
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.<br>
A<br>
/ \<br>
B C<br>
/ \<br>
D D' <br>
<br>
I may not write any code that uses the MarketModel (D) directly on
the Trader (A).<br>
I do understand that there are at least 1 point to keep in mind:<br>
types defined in D will be different from those in D' (typeclasses
will be defined twice)<br>
<br>
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!<br>
<br>
<br>
Cheers,<br>
<br>
<br>
Dimitri<br>
<br>
<br>
<br>
<div class="moz-cite-prefix">Em 10/09/15 06:50, timmy tofu escreveu:<br>
</div>
<blockquote
cite="mid:CADmHUV8MwhYMsmEAy5LNqz2UxnAwWZQDzaS++Uk+=3us-h5Fmw@mail.gmail.com"
type="cite">
<div dir="ltr">
<div class="gmail_extra">
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">
Using the 'cabal sandbox add-source' solution now requires
that I<br>
"add-source" the MarketModel package too. Otherwise, any
change I make<br>
to this package will not be tracked.<br>
</blockquote>
<div><br>
then…<br>
<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">
Cabal sets the paths for "import"ed<br>
modules in the "hs-source-dirs:" and that is global to the
whole<br>
package.<br>
</blockquote>
<div><br>
I can't tell if you do or do not want ProfitCalculator
and Persistence to track changes made in MarketModel.<br>
<br>
If you do, and both should be in lock-step with it (unlike
your situation with Tax), then you don't have a problem.<br>
<br>
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?<br>
<br>
</div>
</div>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Haskell-Cafe mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a>
<a class="moz-txt-link-freetext" href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a>
</pre>
</blockquote>
<br>
</body>
</html>