Beispiel #1
0
 public Composing(
     ITransducer <TInput, TMedium> left,
     ITransducer <TMedium, TResult> right)
 {
     Sync  = left.SyncCompose(right);
     Async = left.AsyncCompose(right);
 }
Beispiel #2
0
 public AsyncComposing(
     IAsyncTransducer <TInput, TMedium> left,
     IAsyncTransducer <TMedium, TResult> right)
 {
     Left  = left;
     Right = right;
 }
Beispiel #3
0
 /// <summary>
 /// Composes two transducers together by attaching the output of the first to the input of the second.
 /// </summary>
 /// <typeparam name="A">The input.</typeparam>
 /// <typeparam name="B">b</typeparam>
 /// <typeparam name="C">c</typeparam>
 /// <typeparam name="D">d</typeparam>
 /// <typeparam name="E">e</typeparam>
 /// <typeparam name="F">f</typeparam>
 /// <typeparam name="G">The result.</typeparam>
 /// <param name="first">The first.</param>
 /// <param name="second">The second.</param>
 /// <param name="third">The third.</param>
 /// <param name="fourth">The fourth.</param>
 /// <param name="fifth">The fifth.</param>
 /// <param name="sixth">The sixth.</param>
 /// <returns>A transducer composed from the input transducers.</returns>
 public static IAsyncTransducer <A, G> AsyncCompose <A, B, C, D, E, F, G>(
     IAsyncTransducer <A, B> first,
     IAsyncTransducer <B, C> second,
     IAsyncTransducer <C, D> third,
     IAsyncTransducer <D, E> fourth,
     IAsyncTransducer <E, F> fifth,
     IAsyncTransducer <F, G> sixth) => AsyncCompose(first, second, third, fourth, fifth).AsyncCompose(sixth);
Beispiel #4
0
 public static IAsyncReducer <TextWriter, TInput> AsyncWriteReducer <TInput>(
     this IAsyncTransducer <TInput, string> transducer) => transducer.Apply(AsyncWriteReducer());
Beispiel #5
0
 public static IAsyncTransducer <TInput, TResult> Filtering <TInput, TResult>(
     this IAsyncTransducer <TInput, TResult> transducer, Predicate <TResult> test) => transducer.AsyncCompose(Filtering(test));
Beispiel #6
0
 public static IAsyncTransducer <TInput, TResult> Mapping <TInput, TMedium, TResult>(
     this IAsyncTransducer <TInput, TMedium> transducer, Func <TMedium, TResult> map) => transducer.AsyncCompose(Mapping(map));
Beispiel #7
0
 /// <summary>
 /// Composes two transducers together by attaching the output of the first to the input of the second.
 /// </summary>
 /// <typeparam name="A">The input.</typeparam>
 /// <typeparam name="B">b</typeparam>
 /// <typeparam name="C">c</typeparam>
 /// <typeparam name="D">d</typeparam>
 /// <typeparam name="E">The result.</typeparam>
 /// <param name="first">The first.</param>
 /// <param name="second">The second.</param>
 /// <param name="third">The third.</param>
 /// <param name="fourth">The fourth.</param>
 /// <returns>A transducer composed from the input transducers.</returns>
 public static IAsyncTransducer <A, E> AsyncCompose <A, B, C, D, E>(
     IAsyncTransducer <A, B> first,
     IAsyncTransducer <B, C> second,
     IAsyncTransducer <C, D> third,
     IAsyncTransducer <D, E> fourth) => AsyncCompose(first, second, third).AsyncCompose(fourth);
Beispiel #8
0
 /// <summary>
 /// Composes two transducers together by attaching the output of the first to the input of the second.
 /// </summary>
 /// <typeparam name="A">The starting input.</typeparam>
 /// <typeparam name="B">b</typeparam>
 /// <typeparam name="C">c</typeparam>
 /// <typeparam name="D">The output type.</typeparam>
 /// <param name="first">The first.</param>
 /// <param name="second">The second.</param>
 /// <param name="third">The third.</param>
 /// <returns>A transducer composed from the input transducers.</returns>
 public static IAsyncTransducer <A, D> AsyncCompose <A, B, C, D>(
     IAsyncTransducer <A, B> first,
     IAsyncTransducer <B, C> second,
     IAsyncTransducer <C, D> third) => AsyncCompose(first, second).AsyncCompose(third);
Beispiel #9
0
 /// <summary>
 /// Composes two transducers together by attaching the output of the first to the input of the second.
 /// </summary>
 /// <typeparam name="A">The starting input.</typeparam>
 /// <typeparam name="B">b</typeparam>
 /// <typeparam name="C">The output type.</typeparam>
 /// <param name="first">The first transducer.</param>
 /// <param name="second">The second transducer.</param>
 /// <returns>A transducer composed from the input transducers.</returns>
 public static IAsyncTransducer <A, C> AsyncCompose <A, B, C>(
     this IAsyncTransducer <A, B> first,
     IAsyncTransducer <B, C> second) =>
 new AsyncComposing <A, B, C>(first, second);