Converting a function to use tail recursion — a formal study
问题 Has anyone written a formal paper describing a method to (automatically) convert functions to be tail recursive? I am looking for a university-level formal treatment including the limitations (types of functions that can be converted), procedures for conversion, and, if possible, proofs of correctness? Examples in Haskell would be a bonus. 回答1: a method to (automatically) convert functions to be tail recursive? So there are two parts to this: recognizing that a given recursive function can be