Skip to content

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

Closed
@abelbraaksma

Description

@abelbraaksma

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestNew feature or enhancement requesttopic: surface areaAdds functions to the public surface area

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions