[clean-list] (no subject)

Jigang Sun Jigang.Sun at student.paisley.ac.uk
Tue Oct 30 23:33:55 MET 2007


On page 16 of the book Functional programming in Clean at http://www.st.cs.ru.nl/papers/cleanbook/CleanBookI.pdf, operator + is defined as an overloaded function(class) on different type such as Int, Real etc, so each instance of the class is a different function. While an example of polymorphism using this operator was given 

double :: a -> a | + a  //defined on Int, Real etc
double n = n + n

the function double is defined  in terms of overloaded function.

my question is now that each operation + carries on a different type is a different function, so each operation the function double do on a separate type should be semantically different. Could anyone advice me the boundary between the two concepts polymorphism and overloading. From the example on the book and the Clean's permission to define a function in terms of overloaded function, the two concepts are mixing together. 

Thanks. 
Jigang








Legal disclaimer
--------------------------

The information transmitted is the property of the University of Paisley and is intended only for the person or entity 
to which it is addressed and may contain confidential and/or privileged material.  Statements and opinions expressed in this e-mail may not represent those of the company.  Any review, retransmission, dissemination and other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited.
If you received this in error, please contact the sender immediately and delete the material from any computer. 

--------------------------




More information about the clean-list mailing list