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

Uninterpreted extension 'to_yojson'. #9

Open
anentropic opened this issue Jun 4, 2021 · 4 comments
Open

Uninterpreted extension 'to_yojson'. #9

anentropic opened this issue Jun 4, 2021 · 4 comments
Labels
forwarded-to-js-devs This report has been forwarded to Jane Street's internal review system.

Comments

@anentropic
Copy link

I'm trying to work out how to define my own to/from functions for some types that can't be derived automatically

I'm getting this error:

57 |     |> [%to_yojson: (string * Version.t) list]
              ^^^^^^^^^
Error: Uninterpreted extension 'to_yojson'.

I have (preprocess (pps ppx_yojson_conv)) and (libraries yojson) in my dune file

Is something else needed?

Also the readme seems to suggest that Hashtbl can be derived https://github.com/janestreet/ppx_yojson_conv#hash-tables

but:

module X = struct
  type t = (string, string) Hashtbl.t [@@deriving yojson]
end

gives:
Unbound value Hashtbl.t_of_yojson

@anentropic
Copy link
Author

anentropic commented Jun 5, 2021

the former seems to need (libraries ppx_deriving_yojson.runtime)?

@github-iron github-iron added the forwarded-to-js-devs This report has been forwarded to Jane Street's internal review system. label Jun 7, 2021
@smorimoto
Copy link

Is there any update on this? I don't have enough time to take a deep look, but I stuck.

@hhugo
Copy link
Contributor

hhugo commented Aug 10, 2021

It's not to_yojson. It should be [%yojson_of: ...]

@anentropic
Copy link
Author

🤦‍♂️ thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
forwarded-to-js-devs This report has been forwarded to Jane Street's internal review system.
Projects
None yet
Development

No branches or pull requests

4 participants