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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Iterant.intersperse operation #508

Merged
merged 6 commits into from Jan 11, 2018

Conversation

Projects
None yet
2 participants
@oleg-py
Collaborator

oleg-py commented Jan 9, 2018

Closes #501

Hope you're not annoyed by my pull requests yet 馃槄

Not too many tests for this one. I found that ScalaCheck-powered tests check pretty much every stream structure, and since intersperse signature requires pure values, there's not many erroneous cases possible.

@codecov

This comment has been minimized.

codecov bot commented Jan 9, 2018

Codecov Report

Merging #508 into master will increase coverage by <.01%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master     #508      +/-   ##
==========================================
+ Coverage   90.04%   90.04%   +<.01%     
==========================================
  Files         358      359       +1     
  Lines        9338     9380      +42     
  Branches     1792     1810      +18     
==========================================
+ Hits         8408     8446      +38     
- Misses        930      934       +4
@alexandru

This comment has been minimized.

Member

alexandru commented Jan 10, 2018

@oleg-py not annoyed, no way, keep them coming 馃榾

I might have a latency in reviewing PRs though, due to work. Will take a look tonight.

oleg-py and others added some commits Jan 10, 2018

@alexandru

Thanks @oleg-py, a ScalaDoc sample would be cool, otherwise it's ready to be merged.

@@ -978,6 +978,25 @@ sealed abstract class Iterant[F[_], A] extends Product with Serializable {
final def foldRightL[B](b: F[B])(f: (A, F[B], F[Unit]) => F[B])(implicit F: Sync[F]): F[B] =
IterantFoldRightL(self, b, f)(F)
/** Creates a new stream from the source that will emit a specific `separator`
* between every pair of elements.

This comment has been minimized.

@alexandru

alexandru Jan 11, 2018

Member

I think a sample would be cool in the ScalaDoc.

source match {
case NextCursor(_, _, _) | NextBatch(_, _, _) =>
Suspend(F.delay(loop(prepend = false)(source)), source.earlyStop)
case _ => loop(prepend = false)(source)

This comment has been minimized.

@alexandru

alexandru Jan 11, 2018

Member

A minor matter of style / indentation 鈥 consistency is good as it makes it easier to read, probably because the arrangement is more predictable, so in a match statement if you have a branch with the expression on a new line above, it's better if you keep that for the rest of the branches, e.g...

source match {
  case NextCursor(_, _, _) | NextBatch(_, _, _) =>
    Suspend(F.delay(loop(prepend = false)(source)), source.earlyStop)
  case _ => 
    loop(prepend = false)(source) 
}

oleg-py and others added some commits Jan 11, 2018

@alexandru alexandru merged commit f7a20a4 into monix:master Jan 11, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment