
25 Jul
2010
25 Jul
'10
12:21 p.m.
Vo Minh Thu wrote:
2010/7/25 Andrew Coppin
: Since you're interested in comparisons... A method is simply a way of giving the same name to several different functions, and have the compiler pick the correct one based on the argument types. [snip]
Actually in Haskell, the choice of the correct definition is not only based on the argument types. It could be based on the result type:
Yes, quite right. It's also possible to use "phantom types" to make the program do different things even thought the run-time representation of data hasn't changed at all. Haskell is like that. ;-)