T_CSharpx_MaybeExtensions - adutton/commandline GitHub Wiki
Provides convenience extension methods for Maybe.
System.Object
CSharpx.MaybeExtensions
Namespace: CSharpx
Assembly: CommandLine (in CommandLine.dll) Version: 0.0.0
C#
internal static class MaybeExtensionsVB
<ExtensionAttribute>
Friend NotInheritable Class MaybeExtensionsC++
[ExtensionAttribute]
internal ref class MaybeExtensions abstract sealedF#
[<AbstractClassAttribute>]
[<SealedAttribute>]
[<ExtensionAttribute>]
type MaybeExtensions = class endThe MaybeExtensions type exposes the following members.
| Name | Description | |
|---|---|---|
![]()
|
Bind(T1, T2) | Invokes a function on this maybe value that itself yields a maybe. |
![]()
|
Do(T)(Maybe(T), Action(T)) | If contans a value executes an Action(T) delegate over it. |
![]()
|
Do(T1, T2)(Maybe(Tuple(T1, T2)), Action(T1, T2)) | If contans a value executes an Action(T1, T2) delegate over it. |
![]()
|
FromJust(T) | Extracts the element out of a Just(T) and returns a default value if its argument is Nothing(T). |
![]()
|
FromJustOrFail(T) | Extracts the element out of a Just(T) and throws an error if its argument is Nothing(T). |
![]()
|
GetValueOrDefault(T) | If contains a values returns it, otherwise returns noneValue. |
![]()
|
IsJust(T) |
Returns true iffits argument is of the form Just(T). |
![]()
|
IsNothing(T) |
Returns true iffits argument is of the form Nothing(T). |
![]()
|
Map(T1, T2) | Transforms this maybe value by using a specified mapping function. |
![]()
|
MapValueOrDefault(T1, T2) | If contains a values executes a mapping function over it, otherwise returns noneValue. |
![]()
|
Match(T)(Maybe(T), Action(T), Action) | Provides pattern matching using Action delegates. |
![]()
|
Match(T1, T2)(Maybe(Tuple(T1, T2)), Action(T1, T2), Action) | Provides pattern matching using Action delegates over maybe with tupled wrapped value. |
![]()
|
MatchJust(T1, T2) |
Matches a value returning true and tupled value itself via two output parameters. |
![]()
|
Select(TSource, TResult) | Map operation compatible with Linq. |
![]()
|
SelectMany(TSource, TValue, TResult) | Bind operation compatible with Linq. |
![]()
|
ToEnumerable(T) | Returns an empty list when given Nothing(T) or a singleton list when given a Just(T). |
![]()
|
ToMaybe(T) | Equivalent to monadic Return(T)(T) operation. Builds a Just(T) value in case value is different from its default. |
