4 ms·
OO in F# looks like fusion of multiple concepts into one: - Ad-hoc polymorphism - Infix function application syntax (foo.append bar instead of append foo bar)
by ungzd 10y ago
OO in F# looks like fusion of multiple concepts into one:
- Ad-hoc polymorphism
- Infix function application syntax (foo.append bar instead of append foo bar)
- Product types with named members, records (class members, note that language already has records)
- C# FFI
So I'm not a fan of this "multiple responsibility" approach. For example, you can't use ad-hoc polymorphism unbundled from OOP classes. You can't use records with OOP because it's not bundled into OOP and it has its own records (class members).
"Canonical" OOP should be about message passing and not all these things.
- equalunique 10y agoAre you aware that records are part of OCaml, which combines with functional programming with OOP, similar to F#? https://realworldocaml.org/v1/en/html/records.html https://realworldocaml.org/v1/en/html/records.html