We've already mentioned that Reason functions always accept a single argument and return a single value, but we've been happily using functions that look like they take multiple arguments, for example, xDaysAgo(now, x). How is this possible?
In Reason, functions with multiple arguments are automatically curried. This means that they are actually functions that accept a single argument and return a new function, which accepts the next argument, and so on, forming a chain of single-argument functions that finally return a result. This might seem like it's inefficient, but in practice the compiler can almost always optimize the chain of calls into a single, efficient call. Let's look at the following concrete example, defining xDaysAgo:
let xDaysAgo(now, x) = ...;
This syntax is equivalent to the following (which is supported by...