Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@deriving(jsConverter) in uncurried mode outputs curried functions #6740

Open
bloodyowl opened this issue Apr 21, 2024 · 3 comments
Open

@deriving(jsConverter) in uncurried mode outputs curried functions #6740

bloodyowl opened this issue Apr 21, 2024 · 3 comments

Comments

@bloodyowl
Copy link
Collaborator

Hi!

When switching a project in uncurried mode, it appears that the @deriving(jsConverter) are output in curried mode. I'm seing that #6492 handed @deriving(abstract), would it be possible to also apply this change to jsConverter?

@cometkim
Copy link
Contributor

I remember seeing this on the forum, but I don't know how it was done in the end.

If there is no other context, I think it should be fixed. Let me look into it.

@cometkim
Copy link
Contributor

I just found 639fcfd and seems @deriving(jsConverter) for records is not supported since v11

@bloodyowl Can you share the code you're migrating and the compiler output (including errors/warnings)?

@bloodyowl
Copy link
Collaborator Author

it's mostly for things like polymorphic variants:

@deriving(jsConverter)
type transport = [
  | #api
  | #csv
]

and records:

@deriving(jsConverter)
type site = {
  id: string,
  name: string,
  token: string,
  domain: string,
}

the errors are that the fromJs & toJs appear to be curried functions rather than uncurried ones

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants