/// <summary> /// Executes the Left action if the Either is in a Left state. /// </summary> /// <param name="Left">Function to generate a Right value if in the Left state</param> /// <returns>Returns an unwrapped Right value</returns> public static Unit ifLeftUnsafe <L, R>(EitherUnsafe <L, R> either, Action <L> Left) => either.IfLeftUnsafe(Left);
/// <summary> /// Executes the leftMap function if the Either is in a Left state. /// Returns the Right value if the Either is in a Right state. /// </summary> /// <param name="leftMap">Function to generate a Right value if in the Left state</param> /// <returns>Returns an unwrapped Right value</returns> public static R ifLeftUnsafe <L, R>(EitherUnsafe <L, R> either, Func <L, R> leftMap) => either.IfLeftUnsafe(leftMap);
/// <summary> /// Returns the rightValue if the Either is in a Left state. /// Returns the Right value if the Either is in a Right state. /// </summary> /// <param name="rightValue">Value to return if in the Left state</param> /// <returns>Returns an unwrapped Right value</returns> public static R ifLeftUnsafe <L, R>(EitherUnsafe <L, R> either, R rightValue) => either.IfLeftUnsafe(rightValue);
/// <summary> /// Executes the Left function if the Either is in a Left state. /// Returns the Right value if the Either is in a Right state. /// </summary> /// <param name="Left">Function to generate a Right value if in the Left state</param> /// <returns>Returns an unwrapped Right value</returns> public static R ifLeftUnsafe <L, R>(EitherUnsafe <L, R> either, Func <R> Left) => either.IfLeftUnsafe(Left);