Skip to content

M_CSharpx_MaybeExtensions_ToMaybe__1

Moh.Hassan edited this page Oct 10, 2019 · 1 revision

MaybeExtensions.ToMaybe(T) Method

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

Syntax

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> 

Parameters

 

value
Type: T

Type Parameters

 

T

Return Value

Type: Maybe(T)

Usage Note

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).

See Also

Reference

MaybeExtensions Class
CSharpx Namespace

Clone this wiki locally