MaybeCreationExtensions
Extension methods aimed for creating new instances.
public static Maybe<TOut> Map<TIn, TOut>(this Maybe<TIn> maybe, Func<TIn, Maybe<TOut>> just, Maybe<TOut> alternative)
Maps maybe to just or alternative when nothing.
public static Maybe<TOut> Map<TIn, TOut>(this Maybe<TIn> maybe, Func<TIn, Maybe<TOut>> just, Func<Maybe<TOut>> nothing)
Maps maybe to just or nothing when nothing.
public static Maybe<TOut> Map<TIn, TOut>(this Maybe<TIn> maybe, Func<TIn, Maybe<TOut>> just, TOut alternative)
Maps maybe to just or alternative when nothing.
public static Maybe<TOut> Map<TIn, TOut>(this Maybe<TIn> maybe, Func<TIn, Maybe<TOut>> just, Func<TOut> nothing)
Maps maybe to just or nothing when nothing.
Returns Maybe<T> with the given value.
public static Maybe<TOut> MaybeMap<TIn, TOut>(this Maybe<TIn> maybe, Func<TIn, Maybe<TOut>> mapping)
Maps the value to mapping or returns nothing if no value.
Returns Maybe<T> with value when value is not empty.
Returns Maybe<T> with nothing.
Returns Maybe<T> with nothing when predicate matches.
Returns Maybe<T> with value when not null.
Returns Maybe<T> with value when predicate matches.
Turns the instance into nothing if inner value is null.