/// <summary>
 /// Monadic bind function
 /// https://en.wikipedia.org/wiki/Monad_(functional_programming)
 /// </summary>
 /// <typeparam name="L">Left</typeparam>
 /// <typeparam name="R">Right</typeparam>
 /// <typeparam name="Ret"></typeparam>
 /// <param name="either"></param>
 /// <param name="binder"></param>
 /// <returns>Bound Either</returns>
 public static EitherUnsafe <Ret, R> bind <L, R, Ret>(EitherUnsafe <L, R> either, Func <L, EitherUnsafe <Ret, R> > binder) =>
 either.Bind(binder);
 /// <summary>
 /// Monadic bind function
 /// https://en.wikipedia.org/wiki/Monad_(functional_programming)
 /// </summary>
 /// <typeparam name="L">Left</typeparam>
 /// <typeparam name="R">Right</typeparam>
 /// <typeparam name="Ret"></typeparam>
 /// <param name="self">this</param>
 /// <param name="Right">Right bind function</param>
 /// <param name="Left">Left bind function</param>
 /// <returns>Bound Either</returns>
 public static EitherUnsafe <LRet, RRet> bind <L, R, LRet, RRet>(EitherUnsafe <L, R> either, Func <R, EitherUnsafe <LRet, RRet> > Right, Func <L, EitherUnsafe <LRet, RRet> > Left) =>
 either.Bind(Right, Left);
Beispiel #3
0
 public static EitherUnsafe <L, R> flatten <L, R>(EitherUnsafe <L, EitherUnsafe <L, R> > ma) =>
 ma.Bind(identity);