-
Notifications
You must be signed in to change notification settings - Fork 30
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
feat: implement dropWhile
function
#21
Conversation
b7b1702
to
77a9a8c
Compare
import ox.* | ||
|
||
class SourceOpsDropWhileTest extends AnyFlatSpec with Matchers { | ||
behavior of "Source.drop" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: dropWhile
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
s.dropWhile(_ > 0).toList shouldBe List.empty | ||
} | ||
|
||
it should "drop elements from the source while predicate is true" in scoped { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: If I understand correctly in Adam's review to another PR, scoped
should be replaced with supervised
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
f9bd0b1
to
0b4455e
Compare
ea8a9c3
to
d738f3d
Compare
Drops elements from the source as long as the predicate is satisfied. Note the if predicate fails then subsequent elements are no longer dropped even if they could still satisfy it. Examples: Source.empty[Int].dropWhile(_ > 3).toList // List() Source.fromValues(1, 2, 3).dropWhile(_ < 3).toList // List(3) Source.fromValues(1, 2, 1).dropWhile(_ < 2).toList // List(2, 1)
0b4455e
to
5f66d58
Compare
Drops elements from the source as long as the predicate is satisfied. Note that if the predicate fails then subsequent elements are no longer dropped even if they could still satisfy it.
Examples: