Thu, 07 Oct 1999 19:13:34 -0400, Kevin Atkinson <[EMAIL PROTECTED]> pisze:

> One think I really think it needs is the ability to group a
> collection of functions with a tag.  And then when importing a
> module you can ask to only import that tag.  For example:
> 
> module A
>   list: head tail foldr foldl
>   array: index (!!) foldr foldl
> 
> ...
> 
> import A(list)

You could simply divide it into smaller modules, and maybe provide
a module that only reexports things from all the other modules for
people that prefer having everything in a single piece.

The problems could arise from mutual dependencies, which are not
handled well in current ghc. Also I am a bit worried about the
possibility of module name clashes.

> Also, Haskell currently allows you to explicitly import one module with
> another.  However, I think that this should be extended to be able to
> import part of the module for example:
> 
> module Mod1(module Mod2 hiding foo, module Mod3(foo))
> 
> and the like.

Doesn't suffice importing Mod2 hiding foo, so reexporting module Mod2
should export it without foo? You can qualify Mod2.foo if you want
to use it in Mod1. (I'm not sure if it in fact works this way.)

> Right now when ever a module uses a prelude function you have to
> import it like so:
> 
> import Prelude hiding head
> import Mod1
> 
> which can be VERY annoying when a module overrides a lot of the
> prelude functions.

It would be VERY dangerous if importing some module could hide names
from other modules without a piece of warning. And now you don't
have to hide it from Prelude if you can stand qualifying the name
everywhere. BTW, there should be a good reason to hide a well-known
name from Prelude, because people will be confused.

-- 
 __("<    Marcin Kowalczyk * [EMAIL PROTECTED] http://kki.net.pl/qrczak/
 \__/          GCS/M d- s+:-- a22 C+++>+++$ UL++>++++$ P+++ L++>++++$ E-
  ^^                W++ N+++ o? K? w(---) O? M- V? PS-- PE++ Y? PGP->+ t
QRCZAK                  5? X- R tv-- b+>++ DI D- G+ e>++++ h! r--%>++ y-




Reply via email to