Skip to content

M_CSharpx_MaybeExtensions_Match__2

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

MaybeExtensions.Match(T1, T2) Method (Maybe(Tuple(T1, T2)), Action(T1, T2), Action)

Provides pattern matching using Action delegates over maybe with tupled wrapped value.

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

Syntax

C#

public static void Match<T1, T2>(
	this Maybe<Tuple<T1, T2>> maybe,
	Action<T1, T2> ifJust,
	Action ifNothing
)

VB

<ExtensionAttribute>
Public Shared Sub Match(Of T1, T2) ( 
	maybe As Maybe(Of Tuple(Of T1, T2)),
	ifJust As Action(Of T1, T2),
	ifNothing As Action
)

C++

public:
[ExtensionAttribute]
generic<typename T1, typename T2>
static void Match(
	Maybe<Tuple<T1, T2>^>^ maybe, 
	Action<T1, T2>^ ifJust, 
	Action^ ifNothing
)

F#

[<ExtensionAttribute>]
static member Match : 
        maybe : Maybe<Tuple<'T1, 'T2>> * 
        ifJust : Action<'T1, 'T2> * 
        ifNothing : Action -> unit 

Parameters

 

maybe
Type: CSharpx.Maybe(Tuple(T1, T2))
ifJust
Type: System.Action(T1, T2)
ifNothing
Type: System.Action

Type Parameters

 

T1
T2

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Maybe(Tuple(T1, T2)). 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
Match Overload
CSharpx Namespace

Clone this wiki locally