Synthesizing Object-Oriented and Functional Design to Promote Re-Use
4 comments
·September 7, 2025esafak
The paper presents an "Extensible Visitor" pattern that adds functional "processors" to OO datatypes. One interesting part is that, like Kotlin extensions, you do not have to modify existing classes to do so.
Was this an important paper in its field?
one-punch
For context, see the recent HN discussion on “The Expression Problem and its solutions”:
ux266478
While interesting on a surface level, I find this paper curious. What it describes here is essentially a roundabout way to try and express open type associations ("extending the data set" as it calls it) when the class hierarchy is already occupied as a primitive cognate to sum-types. This is more or less just a grammar to express type classes stapled over a class hierarchy grammar. I think the almost pun-like structure of that is funny, but in all actuality this feels pretty needless.
The strangest aspect of it is that they cite Haskell. Given the date of the paper, I would understand unfamiliarity with Haskell given the implementations[1] that were available at the time weren't very "useful" if you had any kind of latency requirements on your software. That being said it's strange that somebody in 1998 would write a paper like this, know that Haskell was a thing, and also have no knowledge of type classes, which are explicitly designed to fill the role of open type sets.
For those note in the know, functional languages tend to be able to express this open type association in various ways. Type classes are one way, another example beyond Haskell is MaPLe[2]. SML (and ML-only style OCAML) has a somewhat restricted form by way of its module and functor system, and eqtype. MLPolyR has an unrestricted form by way of row polymorphism.
(1998). Java existed, but neither Scala nor Java-with-generics did.
From the conclusion:
"We have presented a programming protocol, Extensible Visitor, that can be used to construct systems with extensible recursive data domains and toolkits. It is a novel combination of the functional and object-oriented programming styles that draws on the strengths of each. The object-oriented style is essential to achieve extensibility along the data dimension, yet tools are organized in a functional fashion, enabling extensibility in the functional dimension. Systems based on the Extensible Visitor can be extended without modification to existing code or recompilation (which is an increasingly important concern)."