-
Notifications
You must be signed in to change notification settings - Fork 74
Changelog
Nils Lück edited this page Oct 15, 2017
·
22 revisions
- Options now implement
IComparable<T>
and overload related comparison operators - Added
ValueOrDefault()
method in Unsafe namespace - Added
ToNullable()
method in Unsafe namespace - Most of Optional.Collections has been merged into Optional itself
- Added methods to flatten enumerables of options (
options.Values()
andoptions.Exceptions()
) - Specific .NET Standard 2.0 target (wherein options are Serializable unlike .NET Standard 1.0)
- .NET Core (.NET Standard 1.0+) support
- Library is now CLS compliant
- Added
MatchSome()
,MatchNone()
, for executing side-effects on Some or None individually - Added
Flatten()
to flatten two nested optionals into one - Added
NotNull()
as an alias forFilter(value => value != null)
- Minor code cleanup, including argument null checks for Funcs and Actions
- Added
[Serializable]
attribute to options. - Added unit tests (e.g. official support) for
default(Option<T>)
etc. (for use in optional parameters etc.)
Note: Although this is a major version increment, there are no breaking changes.
- Added support for iterating over options in foreach loops.
- Added
ToEnumerable()
method, for easily converting options to enumerables. - Added an
Else
method, for easy fallback to another option in case of none. - Added
NoneWhen()
method, as an opposite ofSomeWhen
. - Added possibility of using exception value in
Or
andValueOr
forOption<T, TException>
.
-
Option<T>
andOption<T, TException>
now implementsIEquatable
for improved performance. -
==
and!=
operators have been added for convenience.
- Switched to semantic versioning scheme
- And: I decided to rip away the leading zero, as it was basically used incorrectly
- Added lazily evaluated overloads for key functions, such as
ValueOr
- In this way, the alternative is only evaluated when in a None-state
- Added a
SomeWhen
function, to easily create and filter an optional at the same time - Remembered XML comments in the nuget package :)
- Added methods to check if an optional contains some value (
Contains
andExists
) - Added
Option<T, TException>
, representing an Either-type- As well as several methods for easy interop between
Option<T>
andOption<T, TException>
- As well as several methods for easy interop between
- Various minor improvement to the underlying code-base
- Moved essential option functionality into the actual struct:
- Allows cleaner explicit type specification in
Match
. - Allows access to central functionality without manually having to import namespace.
- Allows cleaner explicit type specification in
- Minor improvements in XML documentation.
- Added unsafe value retrieval.
- Resides in a dedicated
Optional.Unsafe
namespace.
- Resides in a dedicated
- Added equality testing, hashing and string conversion.
- Added method,
Or
, to specify an alternative value ahead of time.
- Initial version