diff --git a/CSharpFunctionalExtensions/Maybe/Maybe.cs b/CSharpFunctionalExtensions/Maybe/Maybe.cs index 678c853e..23f0b7f7 100644 --- a/CSharpFunctionalExtensions/Maybe/Maybe.cs +++ b/CSharpFunctionalExtensions/Maybe/Maybe.cs @@ -3,7 +3,7 @@ namespace CSharpFunctionalExtensions { [Serializable] - public struct Maybe : IEquatable> + public struct Maybe : IEquatable>, IMaybe { private readonly bool _isValueSet; @@ -155,4 +155,14 @@ public struct Maybe /// public static Maybe From(T value) => Maybe.From(value); } + + /// + /// Useful in scenarios where you need to determine if a value is Maybe or not + /// + public interface IMaybe + { + T Value { get; } + bool HasValue { get; } + bool HasNoValue { get; } + } } diff --git a/version.txt b/version.txt index 91f5bfa0..c73b3fa0 100644 --- a/version.txt +++ b/version.txt @@ -1,6 +1,6 @@ -2.29.0 +2.29.1 New features: -* #406 UnitResult overloads for Check, CheckIf, Combine and FailureIf +* #409 IMaybe interface Fixed issues: * None \ No newline at end of file