Info
Version: | 0.7.1 |
Author(s): | James Jensen |
Last Update: | Monday, December 31, 2018 |
.NET Fiddle: | Create the first Fiddle |
Project Url: | https://github.com/j2jensen/callmemaybe |
NuGet Url: | https://www.nuget.org/packages/CallMeMaybe |
Install
Install-Package CallMeMaybe
dotnet add package CallMeMaybe
paket add CallMeMaybe
CallMeMaybe Download (Unzip the "nupkg" after downloading)
Dependencies
1 package depend on this package.
Tags
Traditionally, programmers often use `null` references to represent values that "aren't there", but the problem is that this was never their intended purpose.
- Languages like C# don't provide a way to differentiate between reference variables that can be null and those that are guaranteed not to be.
- The inventor of null references has [apologized](http://en.wikipedia.org/wiki/Tony_Hoare#Quotations) for creating them in the first place, calling them his "billion-dollar mistake."
- This misuse of null references has spread far and wide, leading to the unfortunately-named `Nullable<>` type (which, being a value type, is never actually null), and attributes like `[CanBeNull]` and `[NotNull]` to help programmers know when they can expect a method to treat a null value as legitimate input.
All this leaves us in a position where our best hope of avoiding `NullReferenceException`s lies in trying to make sure that our reference variables are *never* null. But in that case, how do we indicate when a value is *optional*?
Well, that's where `Maybe<>` comes in.