I am a beginner in mozart oz, and I would like to write a simple higher order function, like {{Add 1}2}, the result of which has to be 3. I guess this is something like nested call in C, where a function could call itself? I am not sure how to define this function, should I write
declare
fun {Add I}
or
declare
fun {{Add I}J}
? And I really don't know how to finish such a function. I have tried several times, but I never have it worked.
Something like this should work (untested):