I am learning Jason Hickey's Introduction to Objective Caml. Just have a question about nested functions (currying).
there is a existing question How to understand the "Currying" in Haskell?, but I guess I am seeking for the answer of slightly different question.
It says that we can write let sum = fun i j -> i + j;; as let sum = fun i -> fun j -> i + j;;
My question is simple:
Can I understand the above definition in this way: let sum = fun i -> i + fun j -> j;;?
I know it won't pass the compiler, but I just try to map this kind of OCaml function definition to the mathematics functions.
In my above imagination, we can write the function easily in mathematics, f(i) = i + g(j); and g(j) = j.
Should I always do this kind of logic mapping for easy understanding?