I am by no means an expert, but I find this article to be very superficial, and not very useful for people new to this in terms of learning the core concepts. For instance there is no mention of the Interpreter, Visitor and Composite GoF design patterns, which are crucial to doing functional programming in OO languages. If you are curious about this, it is very well explained in some of the lectures (10, 11, 13, 14, 15) of the OCW MIT course "Elements of Software Construction" 2008 version [1].
For a much more in depth and accurate discussion of the trade offs between functional and OO programming, I recommend the book "Concepts, Techniques, Models of Computer Programming". For instance, this book explains the technique of Impedance Matching to deal with programs where different components have different degrees of what the article's author (very losely) calls "purity".
It's only Java developers and to a lesser extent C# developers that really go nuts for this stuff. Visitor is clearly a framework for expressing multimethods - thus one can say Visitor is merely a workaround for the constriction of expressiveness of a given language - which is a claim made about many of the GoF patterns.
Singletons as a pattern? How is that different to global variables? It isn't.
Design patterns are just a convention; I would be as uncomfortable overusing them as jumping on the current pattern bashing fad.
The Interpreter pattern is just a technique for doing what amounts to pattern matching but in an OO language, the Visitor is its dual, and Composite is handy to represent arbitrary arity trees.
They allow you to represent algebraic types in an OO language, and I guess that they are design patterns because they can be applied systematically in any domain without having to reinvent the wheel, given that designing with them is driven by the information's structure only, just like in regular FP languages.
Abusing them is just as bad as abusing any other design technique, but when applied correctly they greatly improve program structure and maintainability.
Visitors have nothing to do with multimethods. Their purpose, in this context, is to improve maintainability when in a given functional program written in an OO language you would be more likely to add new functions rather than data type variants; Interpreter would be preferable when the opposite is the case.
Do you know of better ways of systematically doing FP design in C++? The article doesn't mention any.
The article isn't about design patterns, it is about using the new functional programming primitives which C++ relatively recently acquired through the standardization process.
Suggesting to use a syntax for lambda or currying or transferring closure parameters or making copies of data in order to avoid thread problems is not remotely within the same category as "visitor pattern".
I understand `constexprs`, returning deep copies, `[]()()`s, std::bind, simd and OMP when he talks about purity, lambdas, currying and parallelization. What do you understand?
A singleton guarantees that one-and-only-one instance of that type/thing is instantiated.
One can create as many global variables of that type/thing as one wants. Whether one refers to the same, singular instance everywhere is not something a global variable guarantees.
One may use a global variable to implement a singleton, but they aren't the same at all.
For a much more in depth and accurate discussion of the trade offs between functional and OO programming, I recommend the book "Concepts, Techniques, Models of Computer Programming". For instance, this book explains the technique of Impedance Matching to deal with programs where different components have different degrees of what the article's author (very losely) calls "purity".
[1] https://ocw.mit.edu/courses/electrical-engineering-and-compu...