New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change Observable: changes for Cats & Iterant consistency #408

Merged
merged 3 commits into from Aug 8, 2017

Conversation

Projects
None yet
1 participant
@alexandru
Member

alexandru commented Aug 8, 2017

Changed these operators to use cats.Eq for equality and cats.Order for ordering, thus becoming consistent with the new ops for Iterant:

  • distinctUntilChanged
  • distinctUntilChangedByKey
  • maxF / maxL
  • maxByF / maxByL
  • minF / minL
  • minByF / minByL

Added:

  • foldF / foldL as an alternative to sumL, but that uses cats.Monoid

Refactored:

  • sumF / sumL now uses foldLeftF, there's no reason for a custom implementation
  • the min/max ops now use a common implementation

Removed operators:

  • distinct
  • distinctByKey

The reason for removal is that these operators are unsafe, needing unbounded buffering and because they rely on a HashSet data-structure, for which we cannot use Cats's type classes even if we tried really hard, since we are missing a type class for "hashCode", plus it would require extra boxing, etc.

The behavior of these operators is actually easy to obtain by means of scan.

@alexandru alexandru changed the title from Change Observable: change distinct operators to Change Observable: changes for Cats & Iterant consistency Aug 8, 2017

@codecov

This comment has been minimized.

codecov bot commented Aug 8, 2017

Codecov Report

Merging #408 into master will decrease coverage by 0.15%.
The diff coverage is 94.59%.

@@            Coverage Diff             @@
##           master     #408      +/-   ##
==========================================
- Coverage   88.37%   88.21%   -0.16%     
==========================================
  Files         342      336       -6     
  Lines        9184     9069     -115     
  Branches     1207     1232      +25     
==========================================
- Hits         8116     8000     -116     
- Misses       1068     1069       +1

@alexandru alexandru merged commit b1eed6e into monix:master Aug 8, 2017

1 check was pending

continuous-integration/travis-ci/pr The Travis CI build is in progress
Details

@alexandru alexandru added this to the 3.0.0 milestone Jan 21, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment