Ix: Correct .Scan() to use matching behavior by viceroypenguin · Pull Request #1787 · dotnet/reactive

@viceroypenguin

The scan operator in most languages includes the seed or first element. This commit updates the Scan operator in System.Interactive to match both Rx.NET and other languages.

Fixes #1672

@viceroypenguin

The scan operator in most languages includes the seed or first element. This commit updates the Scan operator in System.Interactive to match both Rx.NET and other languages.

@akarnokd

Hi. This is a breaking change on an established operator. Imagine, suddenly everyone would get an extra item even though they were fine with not having that first item.

@viceroypenguin

Yes, it is a breaking change. However, it corrects the behavior to match every other implementation of the scan operator (both Rx as well as F#, Haskell, etc.), so it restores expectation of how the operator will work. Breaking change means release should only happen on Major Version (v7).

@viceroypenguin

Alternatives:
a) [Obsolete] the original version with an explanation, but leave it as is, and publish the corrected version under a different name; or
b) Update the documentation to be explicit about the fact that it is an incorrect implementation of the operator, according to common interpretation of scan behavior.

@viceroypenguin

@akarnokd Any thoughts on the three paths forwards?

@akarnokd

Implement the desired operator and behavior in your own library.