I am Software Developer, currently interested in static type languages (TypeScript, Elm, ReScript) mostly in the frontend land, but working actively in Python also. I am available for mentoring.
If function is not a part of language then we can only make it from procedure by making it referencial transparent. If procedure is referencially transparent then it can be called a function. If not then we cannot name anything a function outside of pure FP languages. But this is more about naming, I have no problem to name everything a procedure as it would be at least better than naming everything a function , what is in a most false in imperative languages.
The thing is that map usage is referencially transparent if we pass to it another referencially transparent function. If we don't the composition is a procedure as you have stated, but IMO if function itself doesn't make side effects we can name it a function, it is fully ok and should not be confusing. As I stated before your opinion makes every HOF not pure even though it's implementation has nothing impure.
However, as I've said, you can use a procedure as a way to implement a function.
It's important to understand that it's still a procedure, and it's still executing a series of operations over time, as opposed to being a time-invariant relationship.
HOP (higher order procedures) can implement functions, while not being functions -- but the distinction remains.
I don't think we're particularly disagreeing, except on your use of "is" vs "implements".
I am Software Developer, currently interested in static type languages (TypeScript, Elm, ReScript) mostly in the frontend land, but working actively in Python also. I am available for mentoring.
Ok, yes I think your way of stating that is correct. Function can be implement by procedure. And .map can be co considered as HOF implementation if we use another transparently referencial procedure as an argument.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
A procedure is never a function, but it can implement a function - we call this an algorithm.
If map were a pure function you would not be able to compose it with a procedure in the first place.
If function is not a part of language then we can only make it from procedure by making it referencial transparent. If procedure is referencially transparent then it can be called a function. If not then we cannot name anything a function outside of pure FP languages. But this is more about naming, I have no problem to name everything a procedure as it would be at least better than naming everything a function , what is in a most false in imperative languages.
The thing is that map usage is referencially transparent if we pass to it another referencially transparent function. If we don't the composition is a procedure as you have stated, but IMO if function itself doesn't make side effects we can name it a function, it is fully ok and should not be confusing. As I stated before your opinion makes every HOF not pure even though it's implementation has nothing impure.
A procedure can never be called a function.
However, as I've said, you can use a procedure as a way to implement a function.
It's important to understand that it's still a procedure, and it's still executing a series of operations over time, as opposed to being a time-invariant relationship.
HOP (higher order procedures) can implement functions, while not being functions -- but the distinction remains.
I don't think we're particularly disagreeing, except on your use of "is" vs "implements".
Ok, yes I think your way of stating that is correct. Function can be implement by procedure. And .map can be co considered as HOF implementation if we use another transparently referencial procedure as an argument.