4 ms·
Yes, this is a great example of a pillar of functional programming, pure functions. What is concerning is that your code example, like other pure function examp
by CrimsonCape 4y ago
Yes, this is a great example of a pillar of functional programming, pure functions. What is concerning is that your code example, like other pure function examples out there, implements a math operation a first grader can perform.
It's exceedingly difficult to find a pure functional example that operates on tangible domain-specific data of objects full of state.
- sidlls 4y agoIt's not at all difficult (https://pandoc.org/ https://pandoc.org/). However, I'd hazard a guess that pandoc written in Rust or C (with idioms appropriate to those languages) would be much more performant.
- kaba0 4y agoI’m not as sure, several optimizations are only possible if we know that they can’t/won’t have side effects, and while the compiler can see it after inlining, having it part of the signature does help. Haskell is quite impressive on the performance front.