<Query Kind="FSharpProgram" />

let rec fact n = async {
    if n < 2 then
        return 1
    else
        let! y = fact (n-1)
        return y * n
    }

for n in [0..10] do
    let f = fact n |> Async.RunSynchronously
    printfn "fact %d = %d" n f