Table of Contents

Method Map

Namespace
SodaFlow
Assembly
SodaFlow.dll

Map<T, TResult>(Stream<T>, Func<T, TResult>)

Transforms the values of a stream with the given function. The stream from this call has the value of that function on the value of the input stream.

public static Stream<TResult> Map<T, TResult>(this Stream<T> s, Func<T, TResult> f)

Parameters

s Stream<T>

The stream.

f Func<T, TResult>

Function to apply to change the values. It can make FRP logic or use Sample<T>(Cell<T>), in which case it is equivalent to calling Snapshot<T, TResult>(Stream<T>, Cell<TResult>) on the cell. Other than this, the function must be a pure function.

Returns

Stream<TResult>

A stream which fires values transformed by f for each value fired by this stream.

Type Parameters

T

The type of the stream.

TResult

The type of values fired by the returned stream.