-
-
Notifications
You must be signed in to change notification settings - Fork 423
Frequently Asked Questions
Result
was removed from v5
of language-ext because there was constant confusion about its role. Result
was originally intended simply as an intermediate type for the Try*
lambda-based types and not for public consumption. Unfortunately most people didn't read the documentation and used it thinking it had the same status as Either
, Option
, etc.
The options were to either keep the type and develop it fully or remove it completely.
The reasons for removal are:
- I don't like naming commonly used types in a way that is likely to clash with other common libraries (which is why
Result
was originally parked in another namespace).-
Result
is such a common name that name clashes are likely
-
- Another type already does what everybody wants
Result
to do. It's calledFin<A>
and was named based on the French for 'end', 'finished', 'final', ... i.e. Result.- This is name that is unlikely to clash and is happily slightly less typing.
"Microsoft says 'no'" is something that the C# community should get over. Microsoft consistently make mistakes, just look at how many failed web-frameworks we've had over the years! They shouldn't be seen as the arbiter of how code should be written.
Of course there are also community norms for writing C# code and using camelCase
isn't a norm. So why have I done it?
Primarily, it's because camelCase
names look better in LINQ expressions. And because this library is all about pure-functional programming, we expect to use LINQ, pretty much all of the time. Take a look at the CardGame sample to get an idea of what I am talking about. When your entire application is LINQ then the camelCase
names come into their own and the code starts to look more like an ML language, like F# or Haskell.
So, it's entirely opinionated, and it may sting, but this library isn't about pandering to norms. It's here to rip up the rule book and create a sub-community within the wider C# community that want to do it differently.