Andrew Miloradovsky is a user on functional.cafe. You can follow them or interact with them if you have an account anywhere in the fediverse. If you don't, you can sign up here.

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?

@almost
's type-classes?

In logical terms, "inheritance" is basically enrichment of signatures, respectively, structures:

cs.cmu.edu/~rwh/introsml/modul

@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

@amiloradovsky I guess really what I'm curious about is defining what "functional" means

Andrew Miloradovsky @amiloradovsky

@almost
Well, AFAIK, functional is supposed to be opposite/complementary/dual to procedural. And these "paradigms" correspond to the respective notions of . :
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.