Skip to content

Commit 642e73e

Browse files
committed
Apply review comments, thanks @bartelink, fix naming and doc comments
1 parent 50c236d commit 642e73e

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

src/FSharp.Control.TaskSeq/TaskSeq.fsi

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -726,18 +726,20 @@ type TaskSeq =
726726
static member filterAsync: predicate: ('T -> #Task<bool>) -> source: TaskSeq<'T> -> TaskSeq<'T>
727727

728728
/// <summary>
729-
/// Returns a task sequence that, when iterated, skips <paramref name="count" /> elements of the
730-
/// underlying sequence, and then returns the remainder of the elements. Raises an exception if there are not enough
731-
/// elements in the sequence. See <see cref="drop" /> for a version that does not raise an exception.
729+
/// Returns a task sequence that, when iterated, skips <paramref name="count" /> elements of the underlying
730+
/// sequence, and then yields the remainder. Raises an exception if there are not <paramref name="count" />
731+
/// items. See <see cref="drop" /> for a version that does not raise an exception.
732732
/// See also <see cref="take" /> for the inverse of this operation.
733733
/// </summary>
734734
///
735735
/// <param name="count">The number of items to skip.</param>
736736
/// <param name="source">The input task sequence.</param>
737737
/// <returns>The resulting task sequence.</returns>
738738
/// <exception cref="T:ArgumentNullException">Thrown when the input task sequence is null.</exception>
739-
/// <exception cref="T:ArgumentException">Thrown when <paramref name="count" /> is less than zero.</exception>
740-
/// <exception cref="T:InvalidOperationException">Thrown when count exceeds the number of elements in the sequence.</exception>
739+
/// <exception cref="T:ArgumentException">
740+
/// Thrown when <paramref name="count" /> is less than zero or when
741+
/// it exceeds the number of elements in the sequence.
742+
/// </exception>
741743
static member skip: count: int -> source: TaskSeq<'T> -> TaskSeq<'T>
742744

743745

@@ -748,7 +750,7 @@ type TaskSeq =
748750
/// are not enough elements. See also <see cref="truncate" /> for the inverse of this operation.
749751
/// </summary>
750752
///
751-
/// <param name="count">The number of items to drop.</param>
753+
/// <param name="count">The maximum number of items to drop.</param>
752754
/// <param name="source">The input task sequence.</param>
753755
/// <returns>The resulting task sequence.</returns>
754756
/// <exception cref="T:ArgumentNullException">Thrown when the input task sequence is null.</exception>
@@ -766,8 +768,10 @@ type TaskSeq =
766768
/// <param name="source">The input task sequence.</param>
767769
/// <returns>The resulting task sequence.</returns>
768770
/// <exception cref="T:ArgumentNullException">Thrown when the input task sequence is null.</exception>
769-
/// <exception cref="T:ArgumentException">Thrown when <paramref name="count" /> is less than zero.</exception>
770-
/// <exception cref="T:InvalidOperationException">Thrown when count exceeds the number of elements in the sequence.</exception>
771+
/// <exception cref="T:ArgumentException">
772+
/// Thrown when <paramref name="count" /> is less than zero or when
773+
/// it exceeds the number of elements in the sequence.
774+
/// </exception>
771775
static member take: count: int -> source: TaskSeq<'T> -> TaskSeq<'T>
772776

773777
/// <summary>

src/FSharp.Control.TaskSeq/TaskSeqInternal.fs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -648,9 +648,9 @@ module internal TaskSeqInternal =
648648
use e = source.GetAsyncEnumerator CancellationToken.None
649649

650650
for _ in 1..count do
651-
let! step = e.MoveNextAsync()
651+
let! ok = e.MoveNextAsync()
652652

653-
if not step then
653+
if not ok then
654654
raiseInsufficient ()
655655

656656
while! e.MoveNextAsync() do
@@ -714,8 +714,6 @@ module internal TaskSeqInternal =
714714
let mutable pos = 0
715715

716716
// return items until we've exhausted the seq
717-
// report this line, weird error:
718-
//while! e.MoveNextAsync() && pos < 1 do
719717
while cont do
720718
yield e.Current
721719
pos <- pos + 1

0 commit comments

Comments
 (0)