Total functional programming

For example, any algorithm for which an asymptotic upper bound can be calculated (by a program that itself only uses Walther recursion) can be trivially transformed into a provably-terminating function by using the upper bound as an extra argument decremented on each iteration or recursion.

For example, quicksort is not trivially shown to be substructural recursive, but it only recurs to a maximum depth of the length of the vector (worst-case time complexity O(n2)).

[4] In total functional programming, a distinction is made between data and codata—the former is finitary, while the latter is potentially infinite.

[5] Both Epigram and Charity could be considered total functional programming languages, even though they do not work in the way Turner specifies in his paper.

So could programming directly in plain System F, in Martin-Löf type theory or the Calculus of Constructions.