Quantcast
Channel: ReScript Forum - Latest posts
Viewing all articles
Browse latest Browse all 2592

Oh no, we're toast because of PPX usage

$
0
0

Hey @zth! I’m making a ton of progress on updating Decco. The challenge I’m facing now is that the transformations it does seem to produce a curried function:

Interestingly, the function produced here in the output has only one argument:

CleanShot 2024-04-24 at 15.07.46

There are encoder functions that will take more than one argument, so I’ll need to learn how to produce an uncurried function in the PPX. According to my research so far, OCaml itself has no concept of uncurried functions, right? Only functions that take a tuple as an argument.

I’m assuming that curried VS uncurried is something at the Rescript syntax level and that it happens before the PPX step is run. Is that right? I think this because when I copy-paste the output of the PPX preview into a new file and save, the error goes away.

I’m not sure how Rescript detects curried and uncurried functions at the AST level. Will it be enough to adjust Decco to always produce a function that takes a tuple of arguments instead of an argument directly?

I’ll go ahead and see if I can try that.


Viewing all articles
Browse latest Browse all 2592

Trending Articles