Dr. Axel Rauschmayer suggests, that if your function has non-erasable optional parameters, you should add one more parameter of type unit
:
let add = (~x=0, ~y=0, ()) => x + y;
Incidentally, Reason compiler seems to suggest the same.
Meanwhile, RWO talks about non-erasable parameters but says nothing about the above pattern. Is it just an oversight on Mr. Minsky’s part, is that addition not deemed important, or is that practice actually frowned upon? I mean, it does feel kinda weird to put optional parameters last if you plan to partially apply your function, but maybe I’m missing something.