Skip to content

M_CSharpx_EnumerableExtensions_ToMaybe__1

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

EnumerableExtensions.ToMaybe(T) Method

Turns an empty sequence to Nothing, otherwise Just(sequence).

Namespace: CSharpx
Assembly: CommandLine (in CommandLine.dll) Version: 0.0.0

Syntax

C#

public static Maybe<IEnumerable<T>> ToMaybe<T>(
	this IEnumerable<T> source
)

VB

<ExtensionAttribute>
Public Shared Function ToMaybe(Of T) ( 
	source As IEnumerable(Of T)
) As Maybe(Of IEnumerable(Of T))

C++

public:
[ExtensionAttribute]
generic<typename T>
static Maybe<IEnumerable<T>^>^ ToMaybe(
	IEnumerable<T>^ source
)

F#

[<ExtensionAttribute>]
static member ToMaybe : 
        source : IEnumerable<'T> -> Maybe<IEnumerable<'T>> 

Parameters

 

source
Type: System.Collections.Generic.IEnumerable(T)

Type Parameters

 

T

Return Value

Type: Maybe(IEnumerable(T))

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IEnumerable(T). 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

EnumerableExtensions Class
CSharpx Namespace

Clone this wiki locally