예제 #1
0
        public static void Execute <TOutput, TValue>(this IWriterMonad <TOutput, TValue> self, Action <TValue> onValue, Action <IEnumerable <TOutput> > onOutput)
        {
            WriterResult <TOutput, TValue> result = self.Run();

            onValue(result.Value);
            onOutput(result.Output);
        }
예제 #2
0
            public WriterResult <TOutput, TValue> RunWriter()
            {
                WriterResult <TOutput, TValue> result = _self.RunWriter();

                _action(result.Value);
                return(result);
            }
예제 #3
0
            public WriterResult <TOutput, TValue> RunWriter()
            {
                WriterResult <TOutput, TValue> result = _self.RunWriter();

                if (_selector(result))
                {
                    return(result);
                }
                else
                {
                    return(_elseSource.RunWriter());
                }
            }
예제 #4
0
            public WriterResult <TOutput, TResult> RunWriter()
            {
                WriterResult <TOutput, TValue> result = _self.RunWriter();

                return(_selector(result.Value).RunWriter());
            }
예제 #5
0
 public WriterResult <TOutput, TValue> Run()
 {
     return(WriterResult.Create(_value, _outputs));
 }
예제 #6
0
 public WriterResult <TOutput, Unit> Run()
 {
     return(WriterResult.Create(Unit.Default, new TOutput[1] {
         _output
     }));
 }
예제 #7
0
            public WriterResult <TOutput, TResult> Run()
            {
                WriterResult <TOutput, TValue> result = _self.Run();

                return(WriterResult.Create(_selector(result.Value), result.Output));
            }
예제 #8
0
 public WriterResult <TOutput, TValue> Run()
 {
     return(WriterResult.Create(_value, new TOutput[0]));
 }
예제 #9
0
        public static void Execute <TOutput, TValue>(this IWriterMonad <TOutput, TValue> self, Action <TValue> onValue)
        {
            WriterResult <TOutput, TValue> result = self.RunWriter();

            onValue(result.Value);
        }