|
|
|
|
|
by lobrien
3303 days ago
|
|
I prefer F# as my day-to-day, but I can understand why, for day-to-day challenges, a lot of devs might look at some language features and say "C# has something that's pretty similar." However, use-cases that can be solved elegantly by pattern-matching, type providers, and/or computation expressions are areas where the "C# is good enough" argument is harder to make. One set of use-cases where pattern-matching are particularly valuable is parsing and other times when you're deconstructing / transforming a complex structure. One use-case for a type provider would be, say, taking an XML schema and exposing its structure as a compile-time constraint. One set of use-cases where computation expressions are valuable relate to (oh god I don't want to use the "M"-word) the creation of a small DSL that isolates some type of specialized computation on a parameterized type. For instance, the (built-in) `async` computation expression. Those might sound like fairly esoteric use-cases, but they're really not that uncommon if you do DSL / library development. |
|