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

Increase surface area: TaskSeq.length, lengthBy and lengthByAsync #53

Merged
merged 5 commits into from
Oct 30, 2022

Conversation

abelbraaksma
Copy link
Member

@abelbraaksma abelbraaksma commented Oct 30, 2022

This PR adds the following to the surface area, as part of #38:

/// <summary>
/// Returns the length of the sequence. This operation requires the whole sequence to be evaluated and
/// should not be used on potentially infinite sequences.
/// </summary>
val length: source: taskSeq<'T> -> Task<int>

/// <summary>
/// Returns the length of the sequence of all items for which the <paramref name="predicate" /> returns true.
/// This operation requires the whole sequence to be evaluated and should not be used on potentially infinite sequences.
/// </summary>
val lengthBy: predicate: ('T -> bool) -> source: taskSeq<'T> -> Task<int>

/// <summary>
/// Returns the length of the sequence of all items for which the <paramref name="predicate" /> returns true.
/// This operation requires the whole sequence to be evaluated and should not be used on potentially infinite sequences.
/// If <paramref name="predicate" /> does not need to be asynchronous, consider using <see cref="TaskSeq.lengthBy" />.
/// </summary>
val lengthByAsync: predicate: ('T -> #Task<bool>) -> source: taskSeq<'T> -> Task<int>

@abelbraaksma abelbraaksma changed the title Increase surface area: TaskSeq.length Increase surface area: TaskSeq.length, lengthBy and lengthByAsync Oct 30, 2022
@abelbraaksma
Copy link
Member Author

Let's get this in. It already contains more than just this change.

@abelbraaksma abelbraaksma merged commit 29bf875 into main Oct 30, 2022
@abelbraaksma abelbraaksma deleted the increase-surface-area branch October 30, 2022 11:38
@abelbraaksma abelbraaksma added topic: surface area Adds functions to the public surface area enhancement New feature or request labels Nov 4, 2022
@abelbraaksma abelbraaksma added this to the v0.1.0 milestone Mar 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request topic: surface area Adds functions to the public surface area
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant