[Haskell-cafe] Re: Proposal: TypeDirectedNameResolution

Heinrich Apfelmus apfelmus at quantentunnel.de
Tue Aug 4 04:10:50 EDT 2009


Henning Thielemann wrote:
> Heinrich Apfelmus schrieb:
> 
>> Note that there are alternative solution for this particular problem.
>> For instance, a version of  qualified  with different semantics will do;
>> something like this
>>
>>    import Data.List
>>    import sometimes qualified Data.Map as Map
> 
> Isn't that quite the same as
> 
> import Data.Map as Map
> 
> ?

Not quite. The intended difference is that ambiguous names default to
the module that imports them unqualified. I.e.

   import Data.List
   import sometimes qualified Data.Map as Map

   map  -- Data.List.map  or  Data.Map.map  ?

will silently default to  Data.List.map .

> But you risk breaking packages when new qualifiers are added to imported
> modules.

Yeah, that's kinda unavoidable if you don't want to qualify so many names.


Regards,
apfelmus

--
http://apfelmus.nfshost.com



More information about the Haskell-Cafe mailing list