Hacker News new | ask | show | jobs
by hkon 3478 days ago
Nope, but pattern matching will be in vNext.
1 comments

It's not the same thing.

C# "Pattern Matching" is little more than destructuring or switch on steroids.

However, much like how the compiler assists you when writing subclasseses so that you've implemented all the required methods, real Pattern Matching (F#) gives you the same guarantees from the compiler that you've handled all the possible cases appropriately. This makes real F# pattern matching much more useful than "switch with destructuring" and helps you grow your programs in a safe way. The C# way has all the same problems as the switch statement which gives no feedback about what cases you've handled.

That sounds awesome.
The Yaron Minksy talk Effective ML (https://vimeo.com/14313378) has examples of using pattern matching and algebraic data types.