Sadly, this topic confused me for awhile. Recently, I found that supporting currying for unknown functions is a fairly easy concept. I didn’t realize how easy of a concept this was until I spoke with a postdoc that has experience developing functional language compilers. 🙂 At first I was perplexed by the idea that a single pass compiler was supposed to support calling a function that may not have been defined in code. That didn’t make sense and it still doesn’t make sense! One should only be able to call a function when it has already been defined!
The only time a function may have already been defined but unknown in certain parts of code is when a function requires another function as a parameter. A generic function that takes a function as an argument doesn’t know which function is going to be passed to it… therefore we have an unknown function, inside the body of function definition.