RE: [Haskell] Hierarchical module namespace extensionnotsufficiently flexible

On 10 March 2005 00:14, Iavor Diatchki wrote:
I'm not in favour of this proposal, i.e. point (2) from your original message[1]. I don't think I fully understand it: is there a mistake in the last example of point (2)? The other examples can be achieved in a clearer way with a 'qualified module' export.
[1] http://www.haskell.org//pipermail/libraries/2005-March/003404.html I am not sure if it is a good idea either. There indeed was a bug in
On Wed, 9 Mar 2005 23:09:26 -0000, Simon Marlow
wrote: the last example of both (2) and (3), the imports should both have an "as T" in the end. The difference between (2) and (3) is what _unqualified_ names get introduced in the importing module. In (2) one would get unqualified names as usual, but the qualified names would have an additional prefix. In (3) there is no way to get unqiualified names at all. I am not sure that there are situations where (2) is neccessary, but I don't think this effect can be achieved using only (3). I agree that we should perhaps go with the simplest and only have alternative (3).
I challenge you to find something you can do with (2) but not with the existing module system + 'qualified module' exports. On the other hand, if you don't care about (2), can we forget about it and simplify the discussion? I don't think anyone else was asking for it. Cheers, Simon

Hello,
On Thu, 10 Mar 2005 09:15:57 -0000, Simon Marlow
On the other hand, if you don't care about (2), can we forget about it and simplify the discussion? I don't think anyone else was asking for it. Sure, that's fine by me. I wasn't asking for this feature either, I was just enumerating different options as I think before making extensions to the language (even small ones like this one) it is good to know what the design space is.
Does anyone have any thoughts about what should happen in the following example? module A (qualified module A) where { f = 'f' } module B (module A) where { import A; ... } module C where { import B; ... } How do we refer to 'f' in B? I think the proposal suggests "A.f" or "A.A.f". How do we refer to 'f' in C? I think the proposal suggests that "f" is not in scope in C. The reason is that "B" does not export "f", because there is no "f" and "A.f" in scope. It seems that we cannot re-export qualified exports using module-style exports. Is this the intended design choice, or am I missing something? -Iavor
participants (2)
-
Iavor Diatchki
-
Simon Marlow