Suppose there was a language that had rust's structures with support immutable manipulations. So you can define methods on the structures, but there's no inheritance. I guess that's basically just rust's structures — would people consider programming using these functional?
@almost
Inheritance has very little to do with functionality.
@amiloradovsky That seems reasonable, but I can't think of code that relies heavily on inheritance that's considered functional. Got any examples?
@amiloradovsky Great points! I've hardly used 'include' and never personally haskell's inheritance but I stand corrected. Yeah I think 'functional' and 'inheritance' are not super well defined in general
@almost
Well, AFAIK, functional is supposed to be opposite/complementary/dual to procedural. And these "paradigms" correspond to the respective notions of #math. #logic:
In math. logic one could define functions as special relations or relations as special functions, but instead the theory considers functions and relations on equal basis, and I suppose the same approach should be taken for programming languages.
Perhaps "purity" is just that — "proper" functions wrapped into "proper" procedures.