[Haskell] Re: Data.Set whishes
wolfgang at jeltsch.net
Fri Feb 20 12:42:55 EST 2004
Am Freitag, 20. Februar 2004 10:23 schrieb Koen Claessen:
> > http://www.haskell.org/hierarchical-modules/libraries/library-design.html
> I have always wondered why the module system is not used at all in these
> conventions. I mean, the function names seem to come straight from the
> Haskell 1.2 days when there was no module system!
> What I mean is, instead of:
> newIORef, writeIORef, readIORef
> We could have:
> IORef.new, IORef.write, IORef.read
> (Or: new, write, read if all we use are IORefs.)
> And instead of:
> mapSet, emptySet, ...
> We have:
> Set.map, Set.empty, ...
> This is how Chris does it in Edison.
> Why isn't this used more?
the naming scheme you mention is nice, in my opinion.
Alas, it has a problem with hierarchical module names. For example, you
cannot write Set.empty but have to write Data.Set.empty instead. As modules
get more and more nested, the qualified names get longer and longer.
A solution would be if Haskell would allow "partially qualified" names, e.g.,
you import Data and are able to say "Set.empty" afterwards.
More information about the Haskell