[Haskell-cafe] Re: Numeric type classes

jerzy.karczmarczuk at info.unicaen.fr jerzy.karczmarczuk at info.unicaen.fr
Thu Sep 14 16:38:37 EDT 2006


Jacques Carette after David Menendez ... : 

... 

>> It gets worse than that. Imagine trying to explain to someone why "1 +
>> sin" is actually "\a -> const 1 a + sin a". 
>> 
> It isn't that hard - it is done routinely in mathematics courses.  In 
> fact, that is what 1+sin means in Maple today (and has for 25 years).  It 
> is also what it means in MuPAD.  

Actually in Maple 1 + sin means 1+sin. Of course, you may write
a:=1+sin;
a(5);
and get 1+sin(5), but replacing "sin" by "jacques" gives Maple a very
similar behaviour. This is just a symbolic, *NOT* a functional object!
(And somehow I am sure that you know that...) MuPAD behaves identically. 

> That is what polymorphism is all about! 

Not in this context, sorry. This is a convention. Another one may give you
an abomination, e.g., 1+sin means 1 plus the addres of the sin routine.
(Of course not in a 'decent' language, but I know a few undecent. 


Jerzy Karczmarczuk


More information about the Haskell-Cafe mailing list