Skip to content

Commit f22e96b

Browse files
committed
remove AsyncSeq.runAsync, iterWhileAsync
1 parent 0c764d6 commit f22e96b

2 files changed

Lines changed: 0 additions & 23 deletions

File tree

src/FSharpx.Async/AsyncSeq.fs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -506,21 +506,6 @@ module AsyncSeq =
506506
| Choice2Of2 e ->
507507
return Choice2Of2 e }
508508

509-
/// Returns an async computation which iterates the async sequence for
510-
/// its side-effects.
511-
let inline runAsync (s:AsyncSeq<unit>) : Async<unit> =
512-
s |> iter id
513-
514-
/// Iterates an async sequence using the specified function until it returns false.
515-
let inline iterWhileAsync (f:'a -> Async<bool>) (s:AsyncSeq<'a>) : Async<unit> =
516-
let rec sink() = asyncSeq {
517-
let c = new AsyncResultCell<_>()
518-
yield (fun a -> f a |> Async.map (fun f -> c.RegisterResult(AsyncOk f, true)))
519-
let! flag = c.AsyncResult
520-
if flag then yield! sink()
521-
else () }
522-
zappAsync (sink()) s |> runAsync
523-
524509
/// Returns elements from an asynchronous sequence while the specified
525510
/// predicate holds. The predicate is evaluated asynchronously.
526511
let rec takeWhileAsync p (input : AsyncSeq<'T>) : AsyncSeq<_> = async {

tests/FSharpx.Async.Tests/AsyncSeqTests.fs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,6 @@ let ``AsyncSeq.zipWithAsync``() =
9999
Assert.True(EQ expected actual)
100100

101101

102-
[<Test>]
103-
let ``AsyncSeq.iterWhileAsync``() =
104-
let s = [1;2;3;4;5] |> AsyncSeq.ofSeq
105-
let seen = ResizeArray<_>()
106-
s |> AsyncSeq.iterWhileAsync (fun x -> seen.Add(x) ; (x < 3) |> async.Return) |> Async.RunSynchronously
107-
Assert.True((seen |> List.ofSeq = [1;2;3]))
108-
109-
110102
[<Test>]
111103
let ``AsyncSeq.skipWhileAsync``() =
112104
let ls = [1;2;3;4;5]

0 commit comments

Comments
 (0)