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

Jonathan Cast jonathanccast at fastmail.fm
Fri Feb 13 14:07:12 EST 2009


On Fri, 2009-02-13 at 12:06 -0700, John A. De Goes wrote:
> On Feb 13, 2009, at 11:49 AM, Jonathan Cast wrote:
> > It breaks type inference.  I explained this at the time.  I can  
> > explain
> > it again:
> >
> >  import Data.List
> >  import Data.Set
> >  import Data.Map
> >
> >  warmFuzzyThingFirstOperation = map
> >
> > This gives an error currently.  Quite properly.  But if *any* use of
> > `map' type-checks, with those imports, why on earth should this one
> > fail?  You don't want to remove a wart from the language, you want to
> > introduce one!
> 
> Umm, no, that would still give an error. See definition of "one and  
> exactly one".

Exactly!  But if it fails, why on earth should any other use of map in
the module succeed?

jcc




More information about the Haskell-Cafe mailing list