The first example is not valid with the F # code, because it let!can only be used directly in the calculation expression. In your example, you use it in a regular function - its body is not an expression of calculation, therefore let!it is not allowed in this position.
To make it valid, you need to wrap the body of the function loopinside async:
MailboxProcessor.Start(fun inbox -> async {
let rec loop bugs = async {
let! msg = inbox.Receive()
let res =
return! loop res }
return! loop []})
async { .. } - return! loop , ( ).
, return! do! - , return! , , . do!, async - , do! .