[Haskell-cafe] One-shot? (was: Global variables and stuff)

Keean Schupke k.schupke at imperial.ac.uk
Fri Nov 12 11:01:36 EST 2004

This still has a problem. Lets say B implements some useful function that
relies on A. Now also C implements some different useful function and also
relies on A in its implementation. If there is only one A.a then using 
both B
and C features in the same code will potentally break both B and C. The only
thing that makes sense in this case is that the A imported by B is distinct
from the A imported by C.

The problem as far as I can see it is that you can create sensible 
examples that
require the behaviour to be one way or the other. Perhaps one solution 
is to allow
top level '<-' but to not allow them to be exported?


Robert Dockins wrote:

>> Should values really depend on the order of includes? Even if you 
>> limit things to just
>> newChan in top level '<-' you still don't know if A.a in B the same 
>> A.a in C. Perhaps it
>> is enough to say  A.a only exists once no matter how many times it is 
>> directly or
>> indirectly imported?
> This strikes me as the only sane thing to do.  Are there any reasons 
> you might want C.A.a to be different than B.A.a?
> In addition, perhaps we should require that modules using TWIs not 
> have cicular dependancies.  Then all init actions can be topo sorted 
> by dependencies.
> Would those restrictions solve the problems that have been floating 
> aroud?
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe

More information about the Haskell-Cafe mailing list