|
|
|
|
|
by lomnakkus
3280 days ago
|
|
> Aggregation, composition, encapsulation are as are much as fundamental notions in OOP as inheritance. You say that as if these things are not just as easily expressed in FP -- if not even easier. Aggregation is just records-of-records. Encapsulation is just "abstract data types", e.g. ML modules with abstract members, or non-exported data constructors in Haskell. Another option would be simply closing over whatever you're trying to hide. Another option would be existential types. (There's some overlap among all of these.) Composition... well, actually I'm not sure what exactly you mean by "composition" in the context of OO. Can you explain what you mean? |
|