Header menu logo FSharp.Core

TailCallAttribute Type

Indicates a function that should be called in a tail recursive way inside its recursive scope. A warning is emitted if the function is analyzed as not tail recursive after the optimization phase.

Example

 let mul x y = x * y
 [<TailCall>]
 let rec fact n acc =
     if n = 0
     then acc
     else (fact (n - 1) (mul n acc)) + 23 // warning because of the addition after the call to fact
val mul: x: int -> y: int -> int
val x: int
val y: int
Multiple items
type TailCallAttribute = inherit Attribute new: unit -> TailCallAttribute

--------------------
new: unit -> TailCallAttribute
val fact: n: int -> acc: int -> int
val n: int
val acc: int

Constructors

Constructor Description

TailCallAttribute()

Full Usage: TailCallAttribute()

Returns: TailCallAttribute
Returns: TailCallAttribute

Type something to start searching.