I did an experiment by writing out an uncurried function in Reason, then using refmt to convert it to ocaml. The resulting code uses the [@u ]
decorator in front of the function. I’m guessing then we have a compiler extension that then uses that decorator to know that the function is uncurried? Or perhaps that’s a bucklescript thing. In any case, I’ve updated Decco to produce that decorator on its generated functions, but I’m still getting the compiler error that v_encode
is a curried function where an uncurried function is expected. I’ll keep digging, but would love any ideas you could offer.
Edit, I just looked at how rescript-schema-ppx handles this, and it seems they use Object.magic to cast the function:
Edit again, I see that Spice upgraded already Support uncurried on v11 by mununki · Pull Request #49 · green-labs/ppx_spice · GitHub
Hopefully I can follow what they are doing there, and I see @alex.fedoseev asked here: Quick migration guide to uncurried mode for PPX maintainers?
Hopefully I can figure out how to apply those decorators in the PPX