Functions in Mondrian

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, ...

Get Programming in the .NET Environment now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.