Skip to content

Commit ec9904d

Browse files
committed
Merge pull request #5 from fsprojects/fix-2
Update verision, make Nil/Cons internal
2 parents 1f27359 + 52016db commit ec9904d

6 files changed

Lines changed: 20 additions & 16 deletions

File tree

RELEASE_NOTES.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
### 1.12.2 - 27.03.2015
1+
### 1.13 - 27.03.2015
22
* Renamed to FSharp.Control.AsyncSeq
3+
* Remove surface area
4+
* Hide Nil/Cons from representation of AsyncSeq
35

46
### 1.12.1 - 27.03.2015
57
* Added Async.bindChoice, Async.ParallelIgnore, AsyncSeq.zipWithAsync, AsyncSeq.zappAsync, AsyncSeq.threadStateAsync, AsyncSeq.merge, AsyncSeq.traverseOptionAsync, AsyncSeq.traverseChoiceAsync

docs/content/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ This includes additional brief samples on using most of the functions.
2222

2323
[Terminology](terminology.html) a reference for some of the terminology around F# async.
2424

25-
[FSharp.Control.AsyncSeq](library/fsharp-control-AsyncSeq.html) contains narrative and code samples explaining asynchronous sequences.
25+
[FSharp.Control.AsyncSeq](library/AsyncSeq.html) contains narrative and code samples explaining asynchronous sequences.
2626

2727
Contributing and copyright
2828
--------------------------

docs/content/library/AsyncSeq.fsx

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
# F# Async: FSharp.Control.AsyncSeq
44
55
An AsyncSeq is a sequence in which individual elements are retrieved using an `Async` computation.
6-
It is similar to `seq<'a>` in that subsequent elements are pulled lazily. Structurally it is
6+
It is similar to `seq<'a>` in that subsequent elements are pulled on-demand. Structurally it is
77
similar to `list<'a>` with the difference being that each head and tail node or empty node is wrapped
8-
in `Async`. `AsyncSeq` also bears similarity to `IObservable<'a>` with the former being pull-based and the
9-
latter push-based. Analogs for most operations defined for `Seq`, `List` and `IObservable` are also defined for
8+
in `Async`. `AsyncSeq` also bears similarity to `IObservable<'a>` with the former being based on an "asynchronous pull" and the
9+
latter based on a "synchronous push". Analogs for most operations defined for `Seq`, `List` and `IObservable` are also defined for
1010
`AsyncSeq`. The power of `AsyncSeq` lies in that many of these operations also have analogs based on `Async`
1111
allowing composition of complex asynchronous workflows.
1212
@@ -144,9 +144,10 @@ in a blocking manner.
144144
### Comparison with IObservable<'a>
145145
146146
Both `IObservable<'a>` and `AsyncSeq<'a>` represent collections of items and both provide similar operations
147-
for transformation and composition. The central difference between the two is that the former is push-based
148-
and the latter is pull-based. Consumers of an `IObservable<'a>` *subscribe* to receive notifications about
149-
new items or the end of the sequence. By contrast, consumers of an `AsyncSeq<'a>` *retrieve* subsequent items on their own
147+
for transformation and composition. The central difference between the two is that the former uses a *synchronous push*
148+
to a subscriber and the latter uses an *asynchronous pull* by a consumer.
149+
Consumers of an `IObservable<'a>` *subscribe* to receive notifications about
150+
new items or the end of the sequence. By contrast, consumers of an `AsyncSeq<'a>` *asynchronously retrieve* subsequent items on their own
150151
terms. Some domains are more naturally modeled with one or the other, however it is less clear which is a more
151152
suitable tool for a specific task. In many cases, a combination of the two provides the optimal solution and
152153
restricting yourself to one, while simplifying the programming model, can lead one to view all problems as a nail.
@@ -237,15 +238,15 @@ let storedTeetsObs' : IObservable<unit> =
237238

238239
(**
239240
Overall, both solutions are succinct and composable and deciding which one to use can ultimately be a matter of preference.
240-
Some things to consider are the push vs. pull semantics. On the one hand, tweets are pushed based - the consumer has no control
241+
Some things to consider are the "synchronous push" vs. "asynchronous pull" semantics. On the one hand, tweets are pushed based - the consumer has no control
241242
over their generation. On the other hand, the program at hand will process the tweets on its own terms regardless of how quickly
242243
they are being generated. Moreover, the underlying Twitter API will likely utilize a request-reply protocol to retrieve batches of
243-
tweets from persistent storage. As such, the distinction between push vs. pull becomes less interesting. If the underlying source
244+
tweets from persistent storage. As such, the distinction between "synchronous push" vs. "asynchronous pull" becomes less interesting. If the underlying source
244245
is truly push-based, then one can buffer its output and consume it using an asynchronous sequence. If the underlying source is pull-based,
245246
then one can turn it into an observable sequence by first pulling, then pushing. Note however that in a true real-time reactive system,
246247
notifications must be pushed immediately without delay.
247248
248-
Upon closer inspection, the consumption approaches between the two models aren't all too different. While `AsyncSeq` is pull based,
249+
Upon closer inspection, the consumption approaches between the two models aren't all too different. While `AsyncSeq` is based on an asynchronous-pull operation,
249250
it is usually consumed using an operator such as `AsyncSeq.iterAsync` as shown above. This is a function of type
250251
`('a -> Async<unit>) -> AsyncSeq<'a> -> Async<unit>` where the first argument is a function `'a -> Async<unit>` which performs
251252
some work on an item of the sequence and is applied repeatedly to subsequent items. In a sense, `iterAsync` *pushes* values to this

docs/tools/templates/template.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
<li class="divider"></li>
4747
<li class="nav-header">Documentation</li>
4848
<li><a href="@Root/terminology.html">Terminology</a></li>
49-
<li><a href="@Root/library/fsharp-control-AsyncSeq.html">AsyncSeq</a></li>
49+
<li><a href="@Root/library/AsyncSeq.html">AsyncSeq</a></li>
5050
<li><a href="@Root/reference/index.html">API Reference</a></li>
5151
</ul>
5252
</div>

src/FSharp.Control.AsyncSeq/AssemblyInfo.fs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ open System.Reflection
44
[<assembly: AssemblyTitleAttribute("FSharp.Control.AsyncSeq")>]
55
[<assembly: AssemblyProductAttribute("FSharp.Control.AsyncSeq")>]
66
[<assembly: AssemblyDescriptionAttribute("Asynchronous sequences for F#")>]
7-
[<assembly: AssemblyVersionAttribute("1.12.2")>]
8-
[<assembly: AssemblyFileVersionAttribute("1.12.2")>]
7+
[<assembly: AssemblyVersionAttribute("1.13")>]
8+
[<assembly: AssemblyFileVersionAttribute("1.13")>]
99
do ()
1010

1111
module internal AssemblyVersionInformation =
12-
let [<Literal>] Version = "1.12.2"
12+
let [<Literal>] Version = "1.13"

src/FSharp.Control.AsyncSeq/AsyncSeq.fs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ type AsyncSeq<'T> = Async<AsyncSeqInner<'T>>
1919

2020
/// The interanl type that represents a value returned as a result of
2121
/// evaluating a step of an asynchronous sequence
22-
and AsyncSeqInner<'T> =
22+
and AsyncSeqInner<'T> =
23+
internal
2324
| Nil
2425
| Cons of 'T * AsyncSeq<'T>
2526

0 commit comments

Comments
 (0)