November 2002
Intermediate to advanced
560 pages
11h 16m
English
In object-oriented languages, functions are members of classes, whereas functional languages normally follow the traditional module and function model. This difference has a fundamental effect on the styles of programming in the two paradigms.
For example, in a functional language, as in many non–object-oriented imperative languages, a sorting function typically takes a comparison function as an argument. In Haskell, the declaration of such a function might be
Sort :: (Integer -> Integer -> Boolean) -> IntList
-> IntList
In the object-oriented model, the replacement for a function value is usually an object with a well-known method. This approach is refined in some languages by specifying an interface, rather than a class, ...
Read now
Unlock full access