Skip to content

Comment on Haskell: OOP vs type classesparent

Comments

* The Haskell guys can use Algebraic Datatypes and type classes to achieve many of the desirable properties of OOP.

* The ML guys can use OCaml, where the O is Objective. Ocaml contains a concept of OOP built into the language already (namely structural subtyping - someone could call this typed duck-typing). The ML guys in general also have another tool for abstraction at their disposal: ML-style functors.

* Erlang programmers often use processes which are self-contained concurrently executing "objects". In Erlang a process is lightweight enough to be considered a "heavy" object in OOP so you often structure your programs around several processes messaging each other to carry out solutions to tasks.

Different languages provides different tools as a means of abstraction. It is all just about unearthing the alternative.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.