What is "imperative" about those first two functions? They don't modify their arguments or count on some global state. They'll always return the same value given the same input.
Yeah, I agree with you. But the characteristics you defined make them pure. And just because they are pure it doesn't mean that they are automatically written in a declarative style.
In the purist FP way, as I understand it, functions should be written in point-free style to achieve the "declarative" data flow.
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.
What is "imperative" about those first two functions? They don't modify their arguments or count on some global state. They'll always return the same value given the same input.
Yeah, I agree with you. But the characteristics you defined make them pure. And just because they are pure it doesn't mean that they are automatically written in a declarative style.
In the purist FP way, as I understand it, functions should be written in point-free style to achieve the "declarative" data flow.