Skip to content
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

Add skipWhile, skipWhileInclusive with async variants, and takeUntil etc #130

Closed
abelbraaksma opened this issue Dec 14, 2022 · 2 comments · Fixed by #219
Closed

Add skipWhile, skipWhileInclusive with async variants, and takeUntil etc #130

abelbraaksma opened this issue Dec 14, 2022 · 2 comments · Fixed by #219
Labels
feature request New feature or enhancement request topic: surface area Adds functions to the public surface area
Milestone

Comments

@abelbraaksma
Copy link
Member

abelbraaksma commented Dec 14, 2022

Similar to #122. The naming should be skipWhile, even though skipUntil was proposed as well in that thread. F# Core has skipWhile, so we should stick with that. Also, I think they are semantically different:

Skip while

  • skipWhile: as long as predicate is true, keep skipping, then stop
  • skipWhileAsync: same, but async
  • skipWhileInclusive: same, but yield first, then test predicate on yielded value
  • skipWhileInclusiveAsync: same, but async

Skip until

  • skipUntil: skip until predicate becomes true
  • skipUntilAsync: same, but async
  • skipUntilInclusive: same, but skip first, then test predicate
  • skipUntilInclusiveAsync:same, but asyncate

And the missing Take Until

We should include these if we do the skipUntilXXX functions:

  • takeUntil: as long as predicate is false, keep skipping, then stop
  • takeUntilAsync: same, but async
  • takeUntilInclusive: same, but yield first, then test predicate on yielded value
  • takeUntilInclusiveAsync: same, but async

Not sure we should have both until and while, as they are logically each other's opposites.

@abelbraaksma abelbraaksma added topic: surface area Adds functions to the public surface area feature request New feature or enhancement request labels Dec 18, 2022
@abelbraaksma abelbraaksma changed the title Add skipWhile, skipWhileInclusive with async variants Add skipWhile, skipWhileInclusive with async variants, and takeUntil etc Oct 30, 2023
@abelbraaksma
Copy link
Member Author

Updated the body of the request to include the async variants and the takeUntil variants as well to complete the block.

@abelbraaksma
Copy link
Member Author

abelbraaksma commented Dec 21, 2023

Note on #183: we (@bartelink and I, well, he convinced me) decided to skip the until variants of these functions, as they were nothing more than the logical inverse (i.e., users can use the not function to reach that functionality).

Further work is through #208 and #219.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or enhancement request topic: surface area Adds functions to the public surface area
Projects
None yet
1 participant