[Haskell-cafe] Design your modules for qualified import
Sebastian Sylvan
sebastian.sylvan at gmail.com
Sat Jun 14 13:38:27 EDT 2008
On 6/14/08, Henning Thielemann <lemming at henning-thielemann.de> wrote:
>
>
> On Sat, 14 Jun 2008, Sebastian Sylvan wrote:
>
> On 6/14/08, Henning Thielemann <lemming at henning-thielemann.de> wrote:
>>
>>>
>>> The problem would be again that no one knows, where "Window" comes from.
>>> Better would be
>>>
>>> I really don't see how this is a big problem. Lots of languages do
>> hierarchical import (e.g. .Net languages) and I don't think I've ever
>> heard
>> anyone complain about this particular aspect of it.
>>
>
> It's not a problem for you and thus you do not pay attention to these
> complaints, I suspect. Maybe the people who would complain about the
> importing style, simply don't use the mentioned languages.
>
>> The worst case scenario is that you need a little bit of tool support to
>> help you sort it out. Plus, it's not like you can't just qualify the import
>> to make it easier to see where it comes from if you really think it's a
>> problem:
>>
>
> Cf.
> http://www.haskell.org/haskellwiki/Import_modules_properly
>
> Haskell can re-export modules, which makes tracing identifiers more
> difficult. I want to be able to read modules without using a tool.
>
I'm not sure I understand you point. You're so opposed to the *option* of
allowing hierarchical exports (even though you can still import it qualified
if you personally like having to specify at each callsite exactly where some
identifier is coming from), that you'd rather any library making use of a
module hierarchy is forced to either make the user add dozens of boilerplate
import statements (with "qualified" and "as") or the more common strategy of
prefixing each function call with the module name (buttonNew)? To me a
module system that requires the latter in practice is horribly broken, and
I'm suggesting a low-impact way of fixing it. It may not be the best system
available, but it's a tiny extension of the current.
I really don't see why adding this option hurts you, when it clearly helps
enable doing what this thread advocates (use qualified modules to
distinguish between functions of the same name, rather than adding a bunch
of prefixes/suffixes to the functions).
--
Sebastian Sylvan
+44(0)7857-300802
UIN: 44640862
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20080614/cd36a38b/attachment.htm
More information about the Haskell-Cafe
mailing list