diff --git a/src/FSharp.Control.TaskSeq/TaskSeq.fsi b/src/FSharp.Control.TaskSeq/TaskSeq.fsi index a58775df..3c14581d 100644 --- a/src/FSharp.Control.TaskSeq/TaskSeq.fsi +++ b/src/FSharp.Control.TaskSeq/TaskSeq.fsi @@ -726,9 +726,9 @@ type TaskSeq = static member filterAsync: predicate: ('T -> #Task) -> source: TaskSeq<'T> -> TaskSeq<'T> /// - /// Returns a task sequence that, when iterated, skips elements of the - /// underlying sequence, and then returns the remainder of the elements. Raises an exception if there are not enough - /// elements in the sequence. See for a version that does not raise an exception. + /// Returns a task sequence that, when iterated, skips elements of the underlying + /// sequence, and then yields the remainder. Raises an exception if there are not + /// items. See for a version that does not raise an exception. /// See also for the inverse of this operation. /// /// @@ -736,8 +736,10 @@ type TaskSeq = /// The input task sequence. /// The resulting task sequence. /// Thrown when the input task sequence is null. - /// Thrown when is less than zero. - /// Thrown when count exceeds the number of elements in the sequence. + /// + /// Thrown when is less than zero or when + /// it exceeds the number of elements in the sequence. + /// static member skip: count: int -> source: TaskSeq<'T> -> TaskSeq<'T> @@ -748,7 +750,7 @@ type TaskSeq = /// are not enough elements. See also for the inverse of this operation. /// /// - /// The number of items to drop. + /// The maximum number of items to drop. /// The input task sequence. /// The resulting task sequence. /// Thrown when the input task sequence is null. @@ -766,8 +768,10 @@ type TaskSeq = /// The input task sequence. /// The resulting task sequence. /// Thrown when the input task sequence is null. - /// Thrown when is less than zero. - /// Thrown when count exceeds the number of elements in the sequence. + /// + /// Thrown when is less than zero or when + /// it exceeds the number of elements in the sequence. + /// static member take: count: int -> source: TaskSeq<'T> -> TaskSeq<'T> /// diff --git a/src/FSharp.Control.TaskSeq/TaskSeqInternal.fs b/src/FSharp.Control.TaskSeq/TaskSeqInternal.fs index 0165ba65..d6a33421 100644 --- a/src/FSharp.Control.TaskSeq/TaskSeqInternal.fs +++ b/src/FSharp.Control.TaskSeq/TaskSeqInternal.fs @@ -648,9 +648,9 @@ module internal TaskSeqInternal = use e = source.GetAsyncEnumerator CancellationToken.None for _ in 1..count do - let! step = e.MoveNextAsync() + let! ok = e.MoveNextAsync() - if not step then + if not ok then raiseInsufficient () while! e.MoveNextAsync() do @@ -714,8 +714,6 @@ module internal TaskSeqInternal = let mutable pos = 0 // return items until we've exhausted the seq - // report this line, weird error: - //while! e.MoveNextAsync() && pos < 1 do while cont do yield e.Current pos <- pos + 1