Exemple #1
0
        public static void Map1a()
        {
            bool notCalled = true;
            Func <Either <int, int> > fun = () => { notCalled = false; return(Either <int, int> .OfLeft(1)); };
            var q = Either.Map(Enumerable.Repeat(fun, 1), f => f());

            Assert.True(notCalled);
            q.OnLeft(x => Assert.CalledOnNext(x, ref notCalled));
            q.OnRight(x => Assert.Fail());
        }
Exemple #2
0
 public static Either <IEnumerable <TResult>, TRight> InvokeWith <TSource, TResult, TRight>(
     this Func <TSource, Either <TResult, TRight> > @this,
     IEnumerable <TSource> seq)
 => Either.Map(seq, @this);