4 ms·
The object state is a parameter passed to the function. The number of arguments passed to a function does not affect it's purity. The feed forward recognition p
by injidup 4y ago
The object state is a parameter passed to the function. The number of arguments passed to a function does not affect it's purity. The feed forward recognition phase of an LLM is pure but has billions of parameters. The purity is defined by it's behavior in relation to again.
1. Does it always return the same result for the same input parameters
2. Does it modify anything other than return a value
These two properties define purity. Simple and not odd at all.
- jb1991 4y agoNot sure why you are arguing about this? The issue is about the idiomatic, expected style that surrounds pure functions and functional programming. The posted article goes into this in greater detail (and more elegantly than this thread) as to why the pattern you describe -- passing a big pointer of potentially large composite data to a function (implicitly or otherwise) -- is not in the spirit of FP purity. If you want to be pedantic, you are welcome and you are academically correct, but the tradition of FP in practice is not to do this (as also pointed out in the article). It's not a question how many arguments but rather if there is extraneous data that the function does not need, as would be common with the full object.
- injidup 4y agoNot sure why you are arguing about large classes with extraneous data. If this is how you program your classes and it works for you then great but honestly you should try for small immutable class where possible with pure functions ( methods). It's really liberating.
- FpUser 4y ago>"It's really liberating" What IS really liberating is not being stuck to a single paradigm and let person decide which particular tool use to solve particular problem