M_CSharpx_MaybeExtensions_Match__2 - adutton/commandline GitHub Wiki
Provides pattern matching using Action delegates over maybe with tupled wrapped value.
Namespace: CSharpx
Assembly: CommandLine (in CommandLine.dll) Version: 0.0.0
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
- maybe
- Type: CSharpx.Maybe(Tuple(T1, T2))
- ifJust
- Type: System.Action(T1, T2)
- ifNothing
- Type: System.Action
- T1
- T2
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).