Hacker News new | ask | show | jobs
by tikhonj 4621 days ago
Haskell is fundamentally different from Ruby et al. It has plenty of features for achieving the same goals--say modularity--but there is no 1:1 mapping between those features and Ruby features. Or any OOP features at all.

Basically, you can do the same things but not necessarily in the same ways. For example, Haskell does not have any inheritance the way OO languages do, so that simply doesn't come up. This doesn't mean it's less capable--it just means it's different. Very different.

One example is interfaces: in Haskell, depending on the context, you might use the module system, typeclasses or even just normal types to accomplish the same things as an OOP interface. You can still organize your code in a similar way, but the actual mechanics are different. In fact, since Haskell allows you to explicitly control effects, you have more organizational power!

I hope this clears things up. Ultimately, the details of how you can organize things is going to vary per use case. Perhaps the easiest thing to do is just to pick up basic Haskell and see what larger Haskell programs look like.