3 ms·
Reducing F# or functional programming to lambdas is a bit of a stretch. I don't know F# very well but I understand it is very close to OCaml which I know quite
by p4bl0 6y ago
Reducing F# or functional programming to lambdas is a bit of a stretch. I don't know F# very well but I understand it is very close to OCaml which I know quite well. F# also has algebraic data types, match, type inference, static type checking, etc. I don't know if C# supports all this, but if it does its probably thanks to the existence of F# on the same .NET platform :).
- 1f60c 6y ago> algebraic data types, match, type inference, static type checking Of those, C# only has static type checking. AFAIK C# does have some limited type inference (when using LINQ), but it’s nowhere near as powerful and ubiquitous as F#, where the following is completely valid: let Add a b = a + b and it will be inferred as: let Add (a:int) (b:int) : int = a + b This also works in more complicated cases like when you’re accessing a property on a record, for instance.
- nicoburns 6y agoI think the latest C# also has match (a pattern matching overload of the switch keyword).