[Haskell-cafe] Design your modules for qualified import

Duncan Coutts duncan.coutts at worc.ox.ac.uk
Sun Jun 15 17:17:56 EDT 2008


On Sat, 2008-06-14 at 19:21 +0100, Sebastian Sylvan wrote:

> I think that if GTK did use this system (rather than append the module
> name to the function and export them "flatly") a lot of people would
> resort to ugly hacks like putting the import statements in a file
> somewhere and using the C preprocessor to include it, yuck! (OTOH this
> may be just what's required to convince everyone that we need to
> improve the module system)...

Right. That's exactly why we've not done something like that. With 100+
modules in the Gtk package it's totally infeasible to do qualified
imports of them all.

If we get a proper way to export a non-flat namespace then Gtk2Hs will
certainly switch to using it. Using 'buttonBlah' is horrible but there
is currently nothing better.

There have been a few suggestions along these lines. Check the archives.
I'm not sure what is proposed for haskell', probably nothing since
nothing is currently implemented and we're only supposed to be
standardising existing practise.

Duncan



More information about the Haskell-Cafe mailing list