News for hackers. Stuff that matters.
Re:Why OO Matters in F# by opvasger on Wednesday March 22, 2017 @11:36AM (#13931748)
I don't think annonymous functions have anything special to do with FP or OO for that matter. Maybe someone can fill in on this?

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?

Re:Why OO Matters in F# by Ace17 on Wednesday March 22, 2017 @02:01PM (#13933180)
> I don't think annonymous functions have anything special to do with FP or OO for that matter. Maybe someone can fill in on this?

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.

Re:Why OO Matters in F# by rbehrends on Wednesday March 22, 2017 @02:26PM (#13933389)
Closures were an integral part of Smalltalk's design.

And functions as first class citizens is not a particularly high bar. I mean, C has higher order functions.

Re:Why OO Matters in F# by opvasger on Wednesday March 22, 2017 @04:36PM (#13934660)
I'm excited to use higher-order functions in C someday :)
Re:Why OO Matters in F# by rbehrends on Wednesday March 22, 2017 @06:29PM (#13935621)
You can do that now. Higher-order functions are simply functions that can take other functions as parameters or return them as results. C has been able to do that since forever. It's not something fancy: pretty much every programming language has something along these lines.

What is rarer is closures, but that's a different concept. You can have higher-order functions without having closures.

Re:Why OO Matters in F# by opvasger on Thursday March 23, 2017 @07:10PM (#13945181)
Haha - I'm simply stating that I'm excited to do it and not for it to be possible :P
Re:Why OO Matters in F# by opvasger on Wednesday March 22, 2017 @04:37PM (#13934677)
C# & Java has anonymous functions, but not 1st-class functions AFAIK

EDIT: but then again, they truely are of no use :P hehe

Re:Why OO Matters in F# by ungzd on Wednesday March 22, 2017 @11:57AM (#13931951)
When I last used F#, I had no problems with purity — it's not enforced but it's a default in standard library and it's convenient.