Search code examples
ml

Fun and Fix in ML


I understand fun and fix in ML as :

fix calculates least fix point or simply can allow use of same name inside the call and fun allows to explicitly control scope of the variable also fun is used for non-recursive versions.

I might be wrong. Can anyone specify the difference between fun and fix in ML.


Solution

  • That paper introduces a mini-language, called ML₀, which presents two constructs, lam and fix. The first is for non-recursive function expressions, while the second is a fixpoint combinator that allows defining recursive functions.

    fun is used later on as part of a different language that's meant as a surface language for use by the programmer. fun should be desugared to lam and fix calls, as shown in Figure 5 of the paper.