Z0ne.Maybe by Z0ne.Maybe

<PackageReference Include="Z0ne.Maybe" Version="1.0.0" />

 MaybeCreationExtensions

public static class 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.

public static Maybe<T> MaybeJust<T>(this T value)

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.

public static Maybe<string> MaybeNotEmpty(this string value)

Returns Maybe<T> with value when value is not empty.

public static Maybe<T> MaybeNothing<T>(this T value)

Returns Maybe<T> with nothing.

public static Maybe<T> MaybeNothingWhen<T>(this T value, Func<T, bool> predicate)

Returns Maybe<T> with nothing when predicate matches.

public static Maybe<T> MaybeNotNull<T>(this T value)

Returns Maybe<T> with value when not null.

public static Maybe<T> MaybeWhen<T>(this T value, Func<T, bool> predicate)

Returns Maybe<T> with value when predicate matches.

public static Maybe<T> NotNull<T>(this Maybe<T> maybe)

Turns the instance into nothing if inner value is null.