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

Johannes Waldmann waldmann at imn.htwk-leipzig.de
Wed Jan 25 04:14:40 EST 2006


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

E. g. in Ada, there is "with" and "use", and "use" can be local,
see also http://www.dcs.gla.ac.uk/mail-www/haskell/msg00991.html
(Similar thing is "using namespace" in C++) (in Java, "import" does
really mean "use", since everything is "withed", but that "use" then has
to be global - presumably for the same reason that Ada-with must be
at the start of the module: for maintenance, dependence on
other modules should be clearly visible).

I think the current Haskell definition (import .. qualified .. hiding)
is kludgy. Especially "hiding": that sounds similar in spirit to
a subroutine call  of the kind "call function f but don't execute its
fourth statement".

(PS: now it's enough kidneys from me)
-- 
-- Johannes Waldmann -- Tel/Fax (0341) 3076 6479/80 --
---- http://www.imn.htwk-leipzig.de/~waldmann/ -------



More information about the Haskell-prime mailing list