Skip to content

Conversation

viceroypenguin
Copy link

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

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
Copy link
Collaborator

akarnokd commented Jul 6, 2022

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

@akarnokd Any thoughts on the three paths forwards?

@akarnokd
Copy link
Collaborator

Implement the desired operator and behavior in your own library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inconsistent behavior of the Scan operator
2 participants