by opvasger · 9y ago · 0 comments
In my mind, functional programming is about programming with mathematical functions - Purity - No arbitrary effects being thrown around - Input to output... Ba-Da-Boom-Ba-Da-Bing.
I find this much more valuable as a restriction from the runtime than as a guideline that can be ignored whenever deemed convenient.
That being said, I wouldn't have a job if I couldn't compromise on this :(
Is there any way to enforce some purity in F#? Does the type-system annotate effectfulness?
Anonymous functions are of no use until functions are first-class citizens (otherwise, there's no way to call them!), and this has always been the case in FP languages.
I do agree though that the focus on mathematical "purity" is a much more defining characteristic of FP.
And functions as first class citizens is not a particularly high bar. I mean, C has higher order functions.
What is rarer is closures, but that's a different concept. You can have higher-order functions without having closures.
EDIT: but then again, they truely are of no use :P hehe