RE: module system/namespaces: separate with/use, allow local "use"

| > With the module system, we should make a distinction between declaring | > | > (1) that we want to use a module | > (2) how to bring the module's names into scope | | Perhaps 'import' should be allowed anywhere among definitions. Indeed. Requiring the import clauses to be at the top, and the fixity declarations, makes them easy to find -- but we don't require that for type signatures or class declarations etc. It'd be more consistent to allow imports and fixity declarations anywhere. This'd be a backward compatible change, but it's an utterly un-forced one. It's not something that people complain about much. Simon

Simon Peyton-Jones wrote:
Indeed. Requiring the import clauses to be at the top, and the fixity declarations, makes them easy to find -- but we don't require that for type signatures or class declarations etc. It'd be more consistent to allow imports and fixity declarations anywhere.
The point is to have a notation that brings identifiers fom a different module into scope *locally* (in a let/where block). I am not sure what a local fixity declaration would mean for an operator that is defined in some outer scope. Best regards, -- -- Johannes Waldmann -- Tel/Fax (0341) 3076 6479/80 -- ---- http://www.imn.htwk-leipzig.de/~waldmann/ -------

On Mon, Jan 30, 2006 at 10:13:36AM +0100, Johannes Waldmann wrote:
I am not sure what a local fixity declaration would mean for an operator that is defined in some outer scope.
It would mean a whole new class of obfusciation ability for haskell programmers :) John -- John Meacham - ⑆repetae.net⑆john⑈

john:
It would mean a whole new class of obfusciation ability for haskell programmers :)
Speaking of which, when trying to obfuscate some code once, I was annoyed that I couldn't remove the whitespace around my module decl: I have to write: module G where not: module(G)where Similarly with import decls. It's a little inconsistent, I guess, considering that in most other places I can think of, outside of the module system, parens instead of spaces is valid. It's a very small issue, but does anyone have any opinions on this no-parens rule when lexing the module system? -- Don

Am Montag, 30. Januar 2006 10:13 schrieb Johannes Waldmann:
[...]
I am not sure what a local fixity declaration would mean for an operator that is defined in some outer scope.
I think, it should be handled the same way a local type declaration for a variable that is defined in some outer scope is handled, i.e., it should be disallowed. Best wishes, Wolfgang
participants (5)
-
dons@cse.unsw.edu.au
-
Johannes Waldmann
-
John Meacham
-
Simon Peyton-Jones
-
Wolfgang Jeltsch