|
|
|
|
|
by bryal
2119 days ago
|
|
> OCaml added an object system to ML. CommonLisp added an object system to lisp. Haskell added TypeClasses. Scala is an attempt at an Haskell like language with a full object system. F# and Kotlin both have object systems as well. One could argue actors are a purer form of OO. And so on. Haskell type classes have nothing to do with OOP in the least, and as far as I know, Ocaml is a counterexample rather than an example to your point: they included OOP becsuse it was all the hype at the time of conception, but the OOP features are really quite unpopular today. As you were completely off with Haskell, I can't exactly trust that you're right about any of the other languages "running back to OOP". If anything it seems to me the languages that started out as multi-paradigm FP/OOP have become more purely FP over time, as OOP has failed to prove its worth. |
|
They surely do, OOP like FP, is very fuzzy and since the Simula/Smalltalk days there have been multiple ways to try to represent OOP concepts.
There isn't any OOP language that implements every OOP idea, just like there isn't any FP language that implements every FP idea.
Type classes allow for polymorphism, and combined with modules one can make use of module private implementations for the encapsulation part.
Extensibility can be achieved either by having a type implement multiple type classes, COM v1..vn style, or by delegation.