You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let json =let s =`String"s"in
[%yojson {a = [%y s]; b =2}]
to be rewritten as:
let json =let s =`String"s"in`Assoc [("a", s); ("b", `Int2)]
Antiquotations for patterns
We want this:
match json with
| [%yojson? [%y? `String s]] -> s
| [%yojson? {a = [%y? a]; b = [%y? `Int b]}] ->
Printf.sprintf "%s and %d" (Yojson.Safe.to_string a) b
to be rewritten as:
match json with
| `Strings -> s
|`Assoc [("a", a); ("b", `Int b)] ->
Printf.sprintf "%s and %d" (Yojson.Safe.to_string a) b
The text was updated successfully, but these errors were encountered:
Repository owner
locked and limited conversation to collaborators
Oct 4, 2018
Internals
Ppx_yojson_lib
(Extract Ppx_yojson_lib and tests #5)Ppx_yojson_lib
tests (Extract Ppx_yojson_lib and tests #5)Features
Antiquotations for expressions
We want this:
to be rewritten as:
Antiquotations for patterns
We want this:
to be rewritten as:
The text was updated successfully, but these errors were encountered: