Skip to content

Commit

Permalink
- introduce IOption interface to allow checking options of different …
Browse files Browse the repository at this point in the history
…types for IsSome IsNone comfortably
  • Loading branch information
ax0l0tl committed Jul 11, 2024
1 parent 35fa653 commit 1b131c8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Source/FunicularSwitch/FunicularSwitch.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

<!--#region adapt versions here-->
<MajorVersion>6</MajorVersion>
<MinorAndPatchVersion>1.0</MinorAndPatchVersion>
<MinorAndPatchVersion>1.1</MinorAndPatchVersion>
<!--#endregion-->

<AssemblyVersion>$(MajorVersion).0.0</AssemblyVersion>
Expand Down
8 changes: 7 additions & 1 deletion Source/FunicularSwitch/Option.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,13 @@ public static class Option
public static Task<Option<T>> NoneAsync<T>() => Task.FromResult(Option<T>.None);
}

public readonly struct Option<T> : IEnumerable<T>, IEquatable<Option<T>>
public interface IOption
{
bool IsSome();
bool IsNone();
}

public readonly struct Option<T> : IEnumerable<T>, IEquatable<Option<T>>, IOption
{
public static readonly Option<T> None = default;

Expand Down

0 comments on commit 1b131c8

Please sign in to comment.