News for hackers. Stuff that matters.
Re:OCaml for the Masses (2011) by bad_user on Monday November 26, 2018 @07:36AM (#18532864)
Functions in C# aren't really first class. A static method for example isn't a Func< > or an Action< > and neither are normal methods, both of which are prevalent. To say that C# has first class functions is a misnomer.

And on anonymous methods (delegates), Func< > and Action< >, that there's even a difference between the 3 shows C#'s age and some of its quirks.

> now tuples and pattern matching in C# 7

Note the pattern matching in C# is a far cry from what you get normally in FP languages. First of all C# does not have ADTs, which means it cannot do exhaustiveness checking, making pattern matching only a superficial syntactic sugar.

Tuples are nice though.

> academic functional programming world and presented them in a nice 'friendly' form

This is sort of a marketing myth. C# is not an FP language and I rarely see actual FP built in C# (same goes for Java).

In my opinion you should try out the languages in the "academic functional programming world". Because you'll then notice that C#'s way of doing things is not "friendly", unless by that you mean half baked and annoying ;-)

Re:OCaml for the Masses (2011) by zengid on Monday November 26, 2018 @07:39AM (#18532882)
I totally agree that FP in C# isn't super nice (its clear that it's bolted on) but to match the style of my co-workers, I can't do much more than sneak in a few little things here or there. The bulk of the code is clearly OOP, and I've accepted that, but at least I can have a little fun with some LINQ and a few extra vars that I don't mutate. :)
Re:OCaml for the Masses (2011) by bad_user on Monday November 26, 2018 @09:06AM (#18533402)
True :-)
Re:OCaml for the Masses (2011) by Bizarro on Monday November 26, 2018 @11:07AM (#18534276)
FP is a style of programming and not a language. You can write imperative code in Haskell.