Represents the common interface for all option monads.
Namespace: DotNext Assembly: DotNext.dll Syntaxpublic interface IOptionMonad<T, TSelf> : IOptionMonad<T>, ISupplier<object?>, IFunctional<Func<object?>> where TSelf : struct, IOptionMonad<T, TSelf>
Type Parameters Name Description T
The type of the value in the container.
TSelfThe implementing type.
Operators | Edit this page View Source operator |(in TSelf, T?)Returns the value if present; otherwise return default value.
Declarationpublic static T? operator |(in TSelf container, T? defaultValue)
Parameters Type Name Description TSelf container
The container to check.
T defaultValueThe value to be returned if there is no value present.
Returns Type Description TThe value, if present, otherwise defaultValue
.
Returns non-empty container.
Declarationpublic static TSelf operator |(in TSelf x, in TSelf y)
Parameters Type Name Description TSelf x
The first container.
TSelf yThe second container.
Returns Type Description TSelfThe first non-empty container.
| Edit this page View Source explicit operator T(in TSelf)Attempts to extract the value from the container.
Declarationpublic static abstract explicit operator T(in TSelf container)
Parameters Type Name Description TSelf container
The container.
Returns Type Description TThe extracted value.
| Edit this page View Source operator false(in TSelf)Checks whether the container has no value.
Declarationpublic static bool operator false(in TSelf container)
Parameters Type Name Description TSelf container
The container to check.
Returns Type Description booltrue if this container has no value; otherwise, false.
| Edit this page View Source implicit operator TSelf(T)Places the value to the container.
Declarationpublic static abstract implicit operator TSelf(T value)
Parameters Type Name Description T value
The value to be placed into the container.
Returns Type Description TSelfThe constructed monad.
| Edit this page View Source operator !(in TSelf)Checks whether the container has no value.
Declarationpublic static bool operator !(in TSelf container)
Parameters Type Name Description TSelf container
The container to check.
Returns Type Description booltrue if this container has no value; otherwise, false.
| Edit this page View Source operator true(in TSelf)Checks whether the container has value.
Declarationpublic static bool operator true(in TSelf container)
Parameters Type Name Description TSelf container
The container to check.
Returns Type Description booltrue if this container has value; otherwise, false.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4