Skip to content

Commit 77dfae3

Browse files
authored
Mention the unit option for While (#25037)
Other expressions, like Combine, already mention that there are alternate forms allowed. According to Expert F# 4.0, 4th edition, page 473, Table 16-2: > Used to de-sugar `while ... do ...` within computation expressions. `M<'T>` may optionally be `M<unit>`
1 parent b1a425e commit 77dfae3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/fsharp/language-reference/computation-expressions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ The following table describes methods that can be used in a workflow builder cla
240240
|`TryFinally`|`M<'T> * (unit -> unit) -> M<'T>`|Called for `try...finally` expressions in computation expressions.|
241241
|`TryWith`|`M<'T> * (exn -> M<'T>) -> M<'T>`|Called for `try...with` expressions in computation expressions.|
242242
|`Using`|`'T * ('T -> M<'U>) -> M<'U> when 'T :> IDisposable`|Called for `use` bindings in computation expressions.|
243-
|`While`|`(unit -> bool) * M<'T> -> M<'T>`|Called for `while...do` expressions in computation expressions.|
243+
|`While`|`(unit -> bool) * M<'T> -> M<'T>`or<br /><br />`(unit -> bool) * M<unit> -> M<unit>`|Called for `while...do` expressions in computation expressions.|
244244
|`Yield`|`'T -> M<'T>`|Called for `yield` expressions in computation expressions.|
245245
|`YieldFrom`|`M<'T> -> M<'T>`|Called for `yield!` expressions in computation expressions.|
246246
|`Zero`|`unit -> M<'T>`|Called for empty `else` branches of `if...then` expressions in computation expressions.|

0 commit comments

Comments
 (0)