|
static void | Match< T > (this Maybe< T > maybe, Action< T > ifJust, Action ifNothing) |
| Provides pattern matching using System.Action delegates.
|
|
static void | Match< T1, T2 > (this Maybe< Tuple< T1, T2 > > maybe, Action< T1, T2 > ifJust, Action ifNothing) |
| Provides pattern matching using System.Action delegates over maybe with tupled wrapped value.
|
|
static bool | MatchJust< T1, T2 > (this Maybe< Tuple< T1, T2 > > maybe, out T1 value1, out T2 value2) |
| Matches a value returning true and tupled value itself via two output parameters.
|
|
static Maybe< T > | ToMaybe< T > (this T value) |
| Equivalent to monadic CSharpx.Maybe.Return<T> operation. Builds a CSharpx.Just<T> value in case value is different from its default.
|
|
static Maybe< T2 > | Bind< T1, T2 > (this Maybe< T1 > maybe, Func< T1, Maybe< T2 > > func) |
| Invokes a function on this maybe value that itself yields a maybe.
|
|
static Maybe< T2 > | Map< T1, T2 > (this Maybe< T1 > maybe, Func< T1, T2 > func) |
| Transforms this maybe value by using a specified mapping function.
|
|
static Maybe< TResult > | Select< TSource, TResult > (this Maybe< TSource > maybe, Func< TSource, TResult > selector) |
| Map operation compatible with Linq.
|
|
static Maybe< TResult > | SelectMany< TSource, TValue, TResult > (this Maybe< TSource > maybe, Func< TSource, Maybe< TValue > > valueSelector, Func< TSource, TValue, TResult > resultSelector) |
| Bind operation compatible with Linq.
|
|
static void | Do< T > (this Maybe< T > maybe, Action< T > action) |
| If contains a value executes an System.Action<T> delegate over it.
|
|
static void | Do< T1, T2 > (this Maybe< Tuple< T1, T2 > > maybe, Action< T1, T2 > action) |
| If contans a value executes an System.Action<T1, T2> delegate over it.
|
|
static bool | IsJust< T > (this Maybe< T > maybe) |
| Returns true iffits argument is of the form CSharpx.Just<T>.
|
|
static bool | IsNothing< T > (this Maybe< T > maybe) |
| Returns true iffits argument is of the form CSharpx.Nothing<T>.
|
|
static T | FromJust< T > (this Maybe< T > maybe) |
| Extracts the element out of a CSharpx.Just<T> and returns a default value if its argument is CSharpx.Nothing<T>.
|
|
static T | FromJustOrFail< T > (this Maybe< T > maybe, Exception exceptionToThrow=null) |
| Extracts the element out of a CSharpx.Just<T> and throws an error if its argument is CSharpx.Nothing<T>.
|
|
static T | GetValueOrDefault< T > (this Maybe< T > maybe, T noneValue) |
| If contains a values returns it, otherwise returns noneValue .
|
|
static T2 | MapValueOrDefault< T1, T2 > (this Maybe< T1 > maybe, Func< T1, T2 > func, T2 noneValue) |
| If contains a values executes a mapping function over it, otherwise returns noneValue .
|
|
static T2 | MapValueOrDefault< T1, T2 > (this Maybe< T1 > maybe, Func< T1, T2 > func, Func< T2 > noneValueFactory) |
| If contains a values executes a mapping function over it, otherwise returns the value from noneValueFactory .
|
|
static IEnumerable< T > | ToEnumerable< T > (this Maybe< T > maybe) |
| Returns an empty list when given CSharpx.Nothing<T> or a singleton list when given a CSharpx.Just<T>.
|
|
Provides convenience extension methods for CSharpx.Maybe.
Definition at line 201 of file Maybe.cs.