Table of Contents

Method Merge

Namespace
SodaFlow
Assembly
SodaFlow.dll

Merge<T>(Stream<T>, Stream<T>, Func<T, T, T>)

Merges two streams of the same type into one. An event value on one input goes to the stream from this call.

public static Stream<T> Merge<T>(this Stream<T> s, Stream<T> s2, Func<T, T, T> f)

Parameters

s Stream<T>

The stream.

s2 Stream<T>

The stream to merge this stream with.

f Func<T, T, T>

Function to put the values together. It can make FRP logic or use Sample<T>(Cell<T>). Apart from this the function must be pure.

Returns

Stream<T>

A stream which is the combination of event values from this stream and stream s2.

Type Parameters

T

The type of the stream.

Remarks

The events are simultaneous when one event from this stream and one event from s2 occur in the same transaction. The given function then puts the two together into one. Thus, the stream from this call always has one event or none in each transaction. The event from this stream goes to the left input of that function. The event from s2 goes to the right.

Merge<T, T2>(Stream<T>, Stream<T2>)

Merges this stream with a stream of a different type. The stream from this call fires in each transaction in which one or more of the streams fire.

public static Stream<(Maybe<T>, Maybe<T2>)> Merge<T, T2>(this Stream<T> s, Stream<T2> s2)

Parameters

s Stream<T>

The stream.

s2 Stream<T2>

The second stream to merge with this one.

Returns

Stream<(Maybe<T>, Maybe<T2>)>

A stream of tuples with one element for each of the two streams, in the sequence of the parameters. An element has the value of its stream if that stream fired in the transaction, and no value if it did not.

Type Parameters

T

The type of this stream.

T2

The type of the second stream.

Remarks

One or more elements of each tuple have a value. No input has priority over the other inputs. Thus, the sequence of the parameters changes only the sequence of the elements.

Merge<T, T2, T3>(Stream<T>, Stream<T2>, Stream<T3>)

Merges this stream with two streams of other types. The stream from this call fires in each transaction in which one or more of the three streams fire.

public static Stream<(Maybe<T>, Maybe<T2>, Maybe<T3>)> Merge<T, T2, T3>(this Stream<T> s, Stream<T2> s2, Stream<T3> s3)

Parameters

s Stream<T>

The stream.

s2 Stream<T2>

The second stream to merge with this one.

s3 Stream<T3>

The third stream to merge with this one.

Returns

Stream<(Maybe<T>, Maybe<T2>, Maybe<T3>)>

A stream of tuples with one element for each of the three streams, in the sequence of the parameters. An element has the value of its stream if that stream fired in the transaction, and no value if it did not.

Type Parameters

T

The type of this stream.

T2

The type of the second stream.

T3

The type of the third stream.

Remarks

One or more elements of each tuple have a value. No input has priority over the other inputs. Thus, the sequence of the parameters changes only the sequence of the elements.

Merge<T, T2, T3, T4>(Stream<T>, Stream<T2>, Stream<T3>, Stream<T4>)

Merges this stream with three streams of other types. The stream from this call fires in each transaction in which one or more of the four streams fire.

public static Stream<(Maybe<T>, Maybe<T2>, Maybe<T3>, Maybe<T4>)> Merge<T, T2, T3, T4>(this Stream<T> s, Stream<T2> s2, Stream<T3> s3, Stream<T4> s4)

Parameters

s Stream<T>

The stream.

s2 Stream<T2>

The second stream to merge with this one.

s3 Stream<T3>

The third stream to merge with this one.

s4 Stream<T4>

The fourth stream to merge with this one.

Returns

Stream<(Maybe<T>, Maybe<T2>, Maybe<T3>, Maybe<T4>)>

A stream of tuples with one element for each of the four streams, in the sequence of the parameters. An element has the value of its stream if that stream fired in the transaction, and no value if it did not.

Type Parameters

T

The type of this stream.

T2

The type of the second stream.

T3

The type of the third stream.

T4

The type of the fourth stream.

Remarks

One or more elements of each tuple have a value. No input has priority over the other inputs. Thus, the sequence of the parameters changes only the sequence of the elements.

Merge<T, T2, T3, T4, T5>(Stream<T>, Stream<T2>, Stream<T3>, Stream<T4>, Stream<T5>)

Merges this stream with four streams of other types. The stream from this call fires in each transaction in which one or more of the five streams fire.

public static Stream<(Maybe<T>, Maybe<T2>, Maybe<T3>, Maybe<T4>, Maybe<T5>)> Merge<T, T2, T3, T4, T5>(this Stream<T> s, Stream<T2> s2, Stream<T3> s3, Stream<T4> s4, Stream<T5> s5)

Parameters

s Stream<T>

The stream.

s2 Stream<T2>

The second stream to merge with this one.

s3 Stream<T3>

The third stream to merge with this one.

s4 Stream<T4>

The fourth stream to merge with this one.

s5 Stream<T5>

The fifth stream to merge with this one.

Returns

Stream<(Maybe<T>, Maybe<T2>, Maybe<T3>, Maybe<T4>, Maybe<T5>)>

A stream of tuples with one element for each of the five streams, in the sequence of the parameters. An element has the value of its stream if that stream fired in the transaction, and no value if it did not.

Type Parameters

T

The type of this stream.

T2

The type of the second stream.

T3

The type of the third stream.

T4

The type of the fourth stream.

T5

The type of the fifth stream.

Remarks

One or more elements of each tuple have a value. No input has priority over the other inputs. Thus, the sequence of the parameters changes only the sequence of the elements.

Merge<T, T2, T3, T4, T5, T6>(Stream<T>, Stream<T2>, Stream<T3>, Stream<T4>, Stream<T5>, Stream<T6>)

Merges this stream with five streams of other types. The stream from this call fires in each transaction in which one or more of the six streams fire.

public static Stream<(Maybe<T>, Maybe<T2>, Maybe<T3>, Maybe<T4>, Maybe<T5>, Maybe<T6>)> Merge<T, T2, T3, T4, T5, T6>(this Stream<T> s, Stream<T2> s2, Stream<T3> s3, Stream<T4> s4, Stream<T5> s5, Stream<T6> s6)

Parameters

s Stream<T>

The stream.

s2 Stream<T2>

The second stream to merge with this one.

s3 Stream<T3>

The third stream to merge with this one.

s4 Stream<T4>

The fourth stream to merge with this one.

s5 Stream<T5>

The fifth stream to merge with this one.

s6 Stream<T6>

The sixth stream to merge with this one.

Returns

Stream<(Maybe<T>, Maybe<T2>, Maybe<T3>, Maybe<T4>, Maybe<T5>, Maybe<T6>)>

A stream of tuples with one element for each of the six streams, in the sequence of the parameters. An element has the value of its stream if that stream fired in the transaction, and no value if it did not.

Type Parameters

T

The type of this stream.

T2

The type of the second stream.

T3

The type of the third stream.

T4

The type of the fourth stream.

T5

The type of the fifth stream.

T6

The type of the sixth stream.

Remarks

One or more elements of each tuple have a value. No input has priority over the other inputs. Thus, the sequence of the parameters changes only the sequence of the elements.

Merge<T, T2, T3, T4, T5, T6, T7>(Stream<T>, Stream<T2>, Stream<T3>, Stream<T4>, Stream<T5>, Stream<T6>, Stream<T7>)

Merges this stream with six streams of other types. The stream from this call fires in each transaction in which one or more of the seven streams fire.

public static Stream<(Maybe<T>, Maybe<T2>, Maybe<T3>, Maybe<T4>, Maybe<T5>, Maybe<T6>, Maybe<T7>)> Merge<T, T2, T3, T4, T5, T6, T7>(this Stream<T> s, Stream<T2> s2, Stream<T3> s3, Stream<T4> s4, Stream<T5> s5, Stream<T6> s6, Stream<T7> s7)

Parameters

s Stream<T>

The stream.

s2 Stream<T2>

The second stream to merge with this one.

s3 Stream<T3>

The third stream to merge with this one.

s4 Stream<T4>

The fourth stream to merge with this one.

s5 Stream<T5>

The fifth stream to merge with this one.

s6 Stream<T6>

The sixth stream to merge with this one.

s7 Stream<T7>

The seventh stream to merge with this one.

Returns

Stream<(Maybe<T>, Maybe<T2>, Maybe<T3>, Maybe<T4>, Maybe<T5>, Maybe<T6>, Maybe<T7>)>

A stream of tuples with one element for each of the seven streams, in the sequence of the parameters. An element has the value of its stream if that stream fired in the transaction, and no value if it did not.

Type Parameters

T

The type of this stream.

T2

The type of the second stream.

T3

The type of the third stream.

T4

The type of the fourth stream.

T5

The type of the fifth stream.

T6

The type of the sixth stream.

T7

The type of the seventh stream.

Remarks

One or more elements of each tuple have a value. No input has priority over the other inputs. Thus, the sequence of the parameters changes only the sequence of the elements.

Merge<T, T2, T3, T4, T5, T6, T7, T8>(Stream<T>, Stream<T2>, Stream<T3>, Stream<T4>, Stream<T5>, Stream<T6>, Stream<T7>, Stream<T8>)

Merges this stream with seven streams of other types. The stream from this call fires in each transaction in which one or more of the eight streams fire.

public static Stream<(Maybe<T>, Maybe<T2>, Maybe<T3>, Maybe<T4>, Maybe<T5>, Maybe<T6>, Maybe<T7>, Maybe<T8>)> Merge<T, T2, T3, T4, T5, T6, T7, T8>(this Stream<T> s, Stream<T2> s2, Stream<T3> s3, Stream<T4> s4, Stream<T5> s5, Stream<T6> s6, Stream<T7> s7, Stream<T8> s8)

Parameters

s Stream<T>

The stream.

s2 Stream<T2>

The second stream to merge with this one.

s3 Stream<T3>

The third stream to merge with this one.

s4 Stream<T4>

The fourth stream to merge with this one.

s5 Stream<T5>

The fifth stream to merge with this one.

s6 Stream<T6>

The sixth stream to merge with this one.

s7 Stream<T7>

The seventh stream to merge with this one.

s8 Stream<T8>

The eighth stream to merge with this one.

Returns

Stream<(Maybe<T>, Maybe<T2>, Maybe<T3>, Maybe<T4>, Maybe<T5>, Maybe<T6>, Maybe<T7>, Maybe<T8>)>

A stream of tuples with one element for each of the eight streams, in the sequence of the parameters. An element has the value of its stream if that stream fired in the transaction, and no value if it did not.

Type Parameters

T

The type of this stream.

T2

The type of the second stream.

T3

The type of the third stream.

T4

The type of the fourth stream.

T5

The type of the fifth stream.

T6

The type of the sixth stream.

T7

The type of the seventh stream.

T8

The type of the eighth stream.

Remarks

One or more elements of each tuple have a value. No input has priority over the other inputs. Thus, the sequence of the parameters changes only the sequence of the elements.

Merge<T>(IEnumerable<Stream<T>>, Func<T, T, T>)

Merges a collection of streams of the same type into one. An event on each input goes to the stream from this call.

public static Stream<T> Merge<T>(this IEnumerable<Stream<T>> s, Func<T, T, T> f)

Parameters

s IEnumerable<Stream<T>>

The collection of streams to merge.

f Func<T, T, T>

Function to put the values together. It can make FRP logic or use Sample<T>(Cell<T>). Apart from this the function must be pure.

Returns

Stream<T>

A stream which is the combination of event values from the collection of streams s.

Type Parameters

T

Remarks

The events are simultaneous when more than one stream has an event in the same transaction. The given function then puts them together into one. Thus, the stream from this call always has one event or none in each transaction. The event from the stream earlier in the collection goes to the left input of that function. The event from the stream after it goes to the right.