Wolfgang Jeltsch <[EMAIL PROTECTED]> writes:

> Am Freitag, 20. Februar 2004 10:23 schrieb Koen Claessen:
> > > http://www.haskell.org/hierarchical-modules/libraries/library-design.html
> >
> > What I mean is, instead of:
> >   newIORef, writeIORef, readIORef
> >
> > We could have:
> >   IORef.new, IORef.write, IORef.read
> 
> Alas, it has a problem with hierarchical module names.  For example, you 
> cannot write Set.empty but have to write Data.Set.empty instead.

Use module renaming:
    import Data.Set as Set

> A solution would be if Haskell would allow "partially qualified" names,
> e.g., you import Data and are able to say "Set.empty" afterwards.

There was an optional part of the original proposal for hierarchical
module names, that the last segment of the hierarchy be automatically
regarded as a renaming.  e.g.
    import X.Y.Z
could be treated equivalent to
    import X.Y.Z
    import X.Y.Z as Z
This has been implemented in nhc98 since 2001.

Regards,
    Malcolm
_______________________________________________
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell

Reply via email to