6 ms·
Haskell doesn't use Hindley-Milner. Edit: Also, sub-typing tends to make a lot more sense in a language with value semantics, such as C++, than it does in a la
by detrino 13y ago
Haskell doesn't use Hindley-Milner.
Edit:
Also, sub-typing tends to make a lot more sense in a language with value semantics, such as C++, than it does in a language like Haskell and isn't necessarily about organizing code.
- tel 13y agoWhat do you mean by value semantics here?
- deleted 13y ago[deleted]
- detrino 13y agoC++ gives you the freedom to choose between composition and subtyping to suit your problem without having to worry about an extra indirection if you choose composition. For example, the base member of Composed is not a pointer as it might be in a language with reference semantics: struct Base { int i; }; struct Derived : Base { bool b; }; struct Composed { Base base; bool b; };