[Haskell-cafe] Re: Overloading functions based on arguments?

Jonathan Cast jonathanccast at fastmail.fm
Fri Feb 13 15:08:10 EST 2009

On Fri, 2009-02-13 at 12:15 -0700, John A. De Goes wrote:
> On Feb 13, 2009, at 12:07 PM, Jonathan Cast wrote:
> > Exactly!  But if it fails, why on earth should any other use of map in
> > the module succeed?

> Because more information is known about other usages of map. Such is  
> the nature of type inference.

No it's not.  Type inference -- in Haskell --- means --- by definition!
--- looking up the principle type of each sub-term, specializing it
based on its use, and then generalizing to find the principle type of
the overall term.  Adding information can cause type inference to fail,
but --- in Haskell as it exists --- it cannot cause type inference to
succeed.  Which is good!


More information about the Haskell-Cafe mailing list