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);
        }
            public WriterResult <TOutput, TValue> RunWriter()
            {
                WriterResult <TOutput, TValue> result = _self.RunWriter();

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

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

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

                return(WriterResult.Create(_selector(result.Value), result.Output));
            }
 public WriterResult <TOutput, TValue> Run()
 {
     return(WriterResult.Create(_value, new TOutput[0]));
 }
Exemple #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);
        }