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

John A. De Goes john at n-brain.net
Fri Feb 13 16:37:00 EST 2009

On Feb 13, 2009, at 2:11 PM, Jonathan Cast wrote:
> The compiler should fail when you tell it two mutually contradictory
> things, and only when you tell it two mutually contradictory things.

By definition, it's not a contradiction when the symbol is  
unambiguously typeable. Do you think math textbooks are filled with  
contradictions when they give '+' a different meaning for vectors than  
matrices or real numbers???

Type is implicitly or explicitly a part of the definition of every  
function. It's not the name that need be unique, but the name over a  
given domain. When two functions have different domains, the same name  
can be unambiguously used to describe both of them.

> Adding information cannot remove a contradiction from the information
> set available to the compiler.

But it can and often does, for example, for [] or 4. What's the type  
of either expression without more information?


John A. De Goes
The Evolution of Collaboration

http://www.n-brain.net    |    877-376-2724 x 101

More information about the Haskell-Cafe mailing list