Record types and pattern matching in C#

 ·  Read in about 1 min  ·  146 Words

For those of you who do not follow the Roslyn project, an active discussion is currently going on regarding record classes (read: ADT) and pattern matching in the future version of C#. Neal Gafter wrote a draft spec and a prototype implementation, and both of them are rapidly evolving at this very moment. The prototype is not yet publicly available, but Neal promises that it will be shortly. UPD: The prototype is now published!

What I like most of all in this undertaking is that they didn’t just inject some pieces of F#/Scala/Haskell into C#. It would feel foreign, since the languages have different styles and design principles. Instead they actually designed a feature in such a way that it feels C#, rather than a foreign addition. Kudos to the language design team.

If you have any ideas and/or suggestions, feel free to join the discussion!