Ejemplo n.º 1
0
 //Reader
 public static MaybeT <Reader <TEnvironment, TResult>, Reader <TEnvironment, Maybe <TResult> >, Maybe <TResult>, TResult> SelectMany <TEnvironment, TSource, TMiddle, TResult>
     (this MaybeT <Reader <TEnvironment, TSource>, Reader <TEnvironment, Maybe <TSource> >, Maybe <TSource>, TSource> source,
     Func <TSource, MaybeT <Reader <TEnvironment, TMiddle>, Reader <TEnvironment, Maybe <TMiddle> >, Maybe <TMiddle>, TMiddle> > f,
     Func <TSource, TMiddle, TResult> resultSelector)
 {
     return((MaybeT <Reader <TEnvironment, TResult>, Reader <TEnvironment, Maybe <TResult> >, Maybe <TResult>, TResult>)
            source.BindT(x => f(x).MapT <Reader <TEnvironment, TResult>, Reader <TEnvironment, Maybe <TResult> >, Maybe <TResult>, TResult>(y => resultSelector(x, y))));
 }
Ejemplo n.º 2
0
        //Rws

        public static MaybeT <Rws <TEnvironment, TOutput, TMonoid, TState, TResult>, Rws <TEnvironment, TOutput, TMonoid, TState, Maybe <TResult> >, Maybe <TResult>, TResult> SelectMany <TEnvironment, TOutput, TMonoid, TState, TSource, TMiddle, TResult>
            (this MaybeT <Rws <TEnvironment, TOutput, TMonoid, TState, TSource>, Rws <TEnvironment, TOutput, TMonoid, TState, Maybe <TSource> >, Maybe <TSource>, TSource> source,
            Func <TSource, MaybeT <Rws <TEnvironment, TOutput, TMonoid, TState, TMiddle>, Rws <TEnvironment, TOutput, TMonoid, TState, Maybe <TMiddle> >, Maybe <TMiddle>, TMiddle> > f,
            Func <TSource, TMiddle, TResult> resultSelector)
            where TMonoid : IMonoid <TOutput>
        {
            return((MaybeT <Rws <TEnvironment, TOutput, TMonoid, TState, TResult>, Rws <TEnvironment, TOutput, TMonoid, TState, Maybe <TResult> >, Maybe <TResult>, TResult>)
                   source.BindT(x => f(x).MapT <Rws <TEnvironment, TOutput, TMonoid, TState, TResult>, Rws <TEnvironment, TOutput, TMonoid, TState, Maybe <TResult> >, Maybe <TResult>, TResult>(y => resultSelector(x, y))));
        }