hhugo / deriving-yojson Goto Github PK
View Code? Open in Web Editor NEWParse/convert ocaml value from/to yojson ast
Parse/convert ocaml value from/to yojson ast
Hi,
I was wondering if it was possible to use deriving-yojson on a record where one of the field is a variant of records.
For example:
type t1 = {
t1_field : float;
} deriving (Yojson)
type t2 = {
t2_field : string;
} deriving (Yojson)
type t =
| T1 of t1
| T2 of t2
deriving (Yojson)
type tt = {
name : string;
field : t;
} deriving (Yojson)
Kind Regards,
Julien
I have this issue:
─( 01:00:00 )─< command 0 >────────────────────────────────────────────────────────────────────────{ counter: 0 }─
utop # #camlp4o;;
Camlp4 Parsing version 4.01.0
─( 16:37:00 )─< command 1 >────────────────────────────────────────────────────────────────────────{ counter: 0 }─
utop # #require "deriving-yojson.syntax";;
─( 16:37:05 )─< command 2 >────────────────────────────────────────────────────────────────────────{ counter: 0 }─
utop # #require "deriving-yojson";;
─( 16:37:17 )─< command 3 >────────────────────────────────────────────────────────────────────────{ counter: 0 }─
utop # type t = int deriving (Yojson);;zsh: exit 1 utop
Hi,
I have notice that deriving-yojson does not work when using deriving.0.7. I got an error message saying that Yojson is not a known `class'.
However, it seems that downgrading deriving.0.7 to deriving.0.6.2 "fixed" the issue.
Best Regards,
Julien
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.