cabal design

Simon Peyton-Jones simonpj at microsoft.com
Wed Aug 17 04:17:40 EDT 2005


| > Some kind of 'grafting' or 'mounting' scheme would be needed to
bring a
| > package into the package namespace.
| 
| I disagree that this necessarily mandates a grafting or mounting
| scheme.  Whilst it might be useful, even desirable, it is a separate
| question.

I agree that it's a separate question.  Hence (b) of my message.  If you
want to 
	import module A from package P and 
	import module A from package Q 
	into a single module M of a program, 

you can always do this:
	make a new module AP, that imports A and re-exports it all; 
	compile AP with package P visible and Q hidden
	ditto for AQ
	make M say "import AP; import AQ"

That's essentially what you suggested.  Of course it means that any
"import A.B.C" has to be understood wrt a namespace that may change from
module to module.  I guess that one merit of the grafting scheme is that
you could make a single package-grafting configuration that would apply
to the whole of a program, so that within that program modules were
consistently and uniquely named.

But yes it's a separate question.

Simon


More information about the Libraries mailing list