M_CSharpx_MaybeExtensions_ToMaybe__1 - adutton/commandline GitHub Wiki
Equivalent to monadic Return(T)(T) operation. Builds a Just(T) value in case value is different from its default.
Namespace: CSharpx
Assembly: CommandLine (in CommandLine.dll) Version: 0.0.0
C#
public static Maybe<T> ToMaybe<T>(
this T value
)VB
<ExtensionAttribute>
Public Shared Function ToMaybe(Of T) (
value As T
) As Maybe(Of T)C++
public:
[ExtensionAttribute]
generic<typename T>
static Maybe<T>^ ToMaybe(
T value
)F#
[<ExtensionAttribute>]
static member ToMaybe :
value : 'T -> Maybe<'T>
- value
- Type: T
- T
Type: Maybe(T)
In Visual Basic and C#, you can call this method as an instance method on any object of type . When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).