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

Johannes Waldmann waldmann at imn.htwk-leipzig.de
Tue Jan 31 07:45:33 EST 2006


Simon Marlow wrote:

>>> Perhaps 'import' should be allowed anywhere among definitions.

> [...] Against:
>  - tools that collect imports have to parse the whole file (eg. GHC's
>    dependency analyser)
>  - can't easily see what is imported

only if we keep the idea that "import" both says *that* a module
is imported *and* brings it into scope at the same time.

Ada has "with" at the top (that would answer your objections)
and then allows local "use" for the scoping issues
(but you'd have to "with" any module that you want to "use").

I think the current "import .. qualified .. as .. hiding"
is trying to do too much at the same time.

best regards,
-- 
-- Johannes Waldmann -- Tel/Fax (0341) 3076 6479/80 --
---- http://www.imn.htwk-leipzig.de/~waldmann/ -------



More information about the Haskell-prime mailing list