3 ms·
> 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
by 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).