I often find myself embedding tail recursive functions inside other functions. Since F# 8.0 we can use the [<TailCall>] attribute, but it doesn't compile for nested functions. As an example I would like for the code below to compile.
let fib n
=
[<TailCall>]
let rec loop i a b =
if i = n then a
else loop (i + 1) b (a + b)
loop 0 0 1
I often find myself embedding tail recursive functions inside other functions. Since F# 8.0 we can use the
[<TailCall>]
attribute, but it doesn't compile for nested functions. As an example I would like for the code below to compile.but instead I get