Skip to content

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.

2 participants