[Haskell-cafe] Re: Proposal: TypeDirectedNameResolution

John Meacham john at repetae.net
Thu Aug 13 16:06:37 EDT 2009


On Tue, Jul 28, 2009 at 10:05:29AM -0700, Ryan Ingram wrote:
> On Tue, Jul 28, 2009 at 1:41 AM, Heinrich
> Apfelmus<apfelmus at quantentunnel.de> wrote:
> > While I do agree that qualified names are annoying at times, I think
> > that type directed name disambiguation is a Pandora's box.
> 
> I see where you are going, but I'm not sure I agree.  Let me give an
> example from another language with this kind of resolution: C++.  From
> a purely practical point of view, function overloading in C++ does
> what I want almost all the time.  And when it doesn't do what I want,
> it's always been immediately obvious, and it's a sign that my design
> is flawed.

I would be careful about assuming aspects of C++ will translate to
haskell at the type system level, The reason is that in C++, all type
information flows in one direction, for instance.

int foo(...) {
   ...
   int x = bar(z,y);
   ...
}

all of the types of everything passed to bar and what it returns (x,y,
and z) are fully specified at every call site, so 'name overloading' is
a simple matter of finding the best match. however in haskell this isn't
the case. 'bar' may affect the types used in 'foo'. there is two way
type information passing in haskell. This radically changes the
landscape for what is possible in the two type systems.

        John


-- 
John Meacham - ⑆repetae.net⑆john⑈ - http://notanumber.net/


More information about the Haskell-Cafe mailing list