What, you say, mathematicians just have to use Haskell ??
Stop right there, and read this.
Technically, there’s nothing new to see here at all. Lisp is high-level and low-level. Lisp is multi-paradigm. Lisp has uniform syntax. Blah blah blah. You’ve heard it all.
Still, some people seem to require an “argument from authority” (and usually still keep looking) … in which case you might be persuaded by this.
An extract (describing how
defgeneric can be handily abused to yield whatever you like):
For example, a mathematician who installs under CLOS the traditional mathematical categories must organize his work as follows:
defclassstatements will be used to define what a “set” object is, what a “group” object is, what a “chain complex” object is, and so on.
defgenericstatements will be used to define functions working on these objects, but these “functions” are traditionally called in this case functors in mathematics; therefore one
defgenericstatement for the sum functor, another
defgenericfor the classifying space functor, and so on.
Finally each generic function will have various methods to adapt the generic function to specific cases; for example the product of two objects of some category is also an object of this category with the corresponding structure to be defined. Therefore one product method for the sets, another product method for the magmas, another method for the monoids, and so on. The
change-classfunctions will allow these methods to possibly refer to the less specific ones.