[Haskell-cafe] Design your modules for qualified import

Henning Thielemann lemming at henning-thielemann.de
Sat Jun 14 09:48:26 EDT 2008


On Mon, 9 Jun 2008, Sebastian Sylvan wrote:

> Another BIG reason: It's impossible to export a whole hierarchy qualified.
> I.e it would be neat if the user could write:
>
> import Graphics.UI.Gtk
>
> And then have Gtk re-export sub-modules qualified, so you could write
> "Button.new", "Window.new" etc. etc. As it stands you have two options:
> prefix all the "new" functions with the kind of widget they create
> (buttonNew, windowNew), or force the user to add a gazillion qualified
> imports.

The problem would be again that no one knows, where "Window" comes from. 
Better would be

import Graphics.UI.Gtk (Window, Button, )

Don't know if this extension would be worth the trouble.



More information about the Haskell-Cafe mailing list