Skip to content

Commit 5e71b51

Browse files
committed
fix docs
1 parent c62fbc9 commit 5e71b51

2 files changed

Lines changed: 6 additions & 23 deletions

File tree

docs/AsyncSeqCombining.fsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,10 @@ each element with `Choice<'T1,'T2>` so you can distinguish the source:
288288
type Heartbeat = Heartbeat
289289
type ConfigChange = ConfigChange of string
290290

291-
let heartbeats : AsyncSeq<Heartbeat> = AsyncSeq.replicateInfiniteAsync (async { do! Async.Sleep 5000; return Heartbeat })
291+
let heartbeats : AsyncSeq<Heartbeat> = AsyncSeq.replicateInfiniteAsync (async {
292+
do! Async.Sleep 5000
293+
return Heartbeat
294+
})
292295
let configChanges : AsyncSeq<ConfigChange> = failwith "TODO: long-poll config store"
293296

294297
let merged : AsyncSeq<Choice<Heartbeat, ConfigChange>> =

docs/AsyncSeqTransforming.fsx

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ category: Documentation
55
categoryindex: 2
66
index: 3
77
description: How to transform, filter and reduce F# asynchronous sequences using map, filter, reduce, fold and sum operations.
8-
keywords: F#, asynchronous sequences, AsyncSeq, map, filter, reduce, fold, sum, mapFoldAsync
8+
keywords: F#, asynchronous sequences, AsyncSeq, map, filter, reduce, fold, sum
99
---
1010
*)
1111
(*** condition: prepare ***)
@@ -26,8 +26,7 @@ keywords: F#, asynchronous sequences, AsyncSeq, map, filter, reduce, fold, sum,
2626
2727
# Transforming and Reducing Sequences
2828
29-
This document covers some of the core operations for transforming and aggregating `AsyncSeq<'T>` values:
30-
`map`, `mapAsync`, `filter`, `filterAsync`, `reduceAsync`, `mapFoldAsync`, `sumBy` and `sumByAsync`.
29+
This document covers some of the core operations for transforming and aggregating `AsyncSeq<'T>` values: `map`, `mapAsync`, `filter`, `filterAsync`, `reduceAsync`, `sumBy` and `sumByAsync`.
3130
3231
*)
3332

@@ -137,25 +136,6 @@ let sentence : Async<string> =
137136

138137
(**
139138
140-
### mapFoldAsync
141-
142-
`AsyncSeq.mapFoldAsync` combines a map and a fold in a single pass. The folder function receives
143-
the current accumulator state and an element, and returns an `Async` of a *(result, newState)* pair.
144-
The call returns the array of mapped results together with the final state:
145-
146-
*)
147-
148-
// Number each element with a running index, and count total characters as state.
149-
let numberAndCount : Async<string array * int> =
150-
words
151-
|> AsyncSeq.mapFoldAsync
152-
(fun totalChars word -> async {
153-
let numbered = sprintf "%d: %s" totalChars word
154-
return numbered, totalChars + word.Length })
155-
0
156-
157-
(**
158-
159139
---
160140
161141
## Aggregating Sequences

0 commit comments

Comments
 (0)