2 ms·
Maybe it has to do with coherence of objects as collections of functions and the fact that they contain state. I love objects and talking about them as living
by mucholove 5y ago
Maybe it has to do with coherence of objects as collections of functions and the fact that they contain state.
I love objects and talking about them as living creatures. :)
They’re sort of like functions that include a long set of parameters.
The one thing I wouldn’t know how to do / name in functional pure functional programming is an incremental parser.
My sense is that would probably have to pass an “object” like parameter like in C that gets updated by the function. What am I missing?
- Dzugaru 5y agoYou pass a state and return a new, modified state. You can, however, "pass" many other things in functional programming - see monads (also called computation expressions). I recommend fsharpforfunandprofit website for gentle introduction into FP (and a language called F# which is basically OCaml) and what it can do (especially in parsers area)
- ProfHewitt 5y agoThe monad pattern can much less efficient than concurrency by factors of hundreds.