diff options
author | Armaël Guéneau <armael.gueneau@ens-lyon.org> | 2020-01-27 22:20:04 (CET) |
---|---|---|
committer | Armaël Guéneau <armael.gueneau@ens-lyon.org> | 2020-01-27 22:20:04 (CET) |
commit | a4d9d5554d946e6d1358446e7743b3b49c9fea53 (patch) | |
tree | 3afc36b9f802d38578a23ed59af587ce40dbed02 | |
parent | 2cfab4759a6aee510a27d5ad4f02d210ced479a4 (diff) | |
download | papiers-a4d9d5554d946e6d1358446e7743b3b49c9fea53.tar.gz papiers-a4d9d5554d946e6d1358446e7743b3b49c9fea53.tar.bz2 |
Json.json -> Json.t to accomodate recent yojson
-rw-r--r-- | lib/inner_db.ml | 10 | ||||
-rw-r--r-- | src/config.ml | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/lib/inner_db.ml b/lib/inner_db.ml index 989c2bf..816fc09 100644 --- a/lib/inner_db.ml +++ b/lib/inner_db.ml @@ -77,7 +77,7 @@ module Json = Yojson.Basic (* Converting [t] -> [Json.json] *) -let json_of_document (doc: document): Json.json = +let json_of_document (doc: document): Json.t = let strlst2json = List.map (fun s -> `String s) in let srclst2json = List.map (fun s -> `String (Source.to_string s) @@ -91,15 +91,15 @@ let json_of_document (doc: document): Json.json = "lang", `String doc.content.lang; ] -let json_of_t (db: t): Json.json = +let json_of_t (db: t): Json.t = `List ( fold (fun doc docs -> (json_of_document doc)::docs) db [] ) -(* Converting [Json.json] -> [t] *) +(* Converting [Json.t] -> [t] *) -let document_of_json (json: Json.json): document = +let document_of_json (json: Json.t): document = let open Json.Util in let to_list_option = to_option to_list in @@ -123,7 +123,7 @@ let document_of_json (json: Json.json): document = { id; content = { name; authors; source; tags; lang } } -let t_of_json (json: Json.json): t = +let t_of_json (json: Json.t): t = let open Json.Util in let table = json |> to_list diff --git a/src/config.ml b/src/config.ml index 86ff189..0fea098 100644 --- a/src/config.ml +++ b/src/config.ml @@ -11,7 +11,7 @@ type userconfig = { external_reader : string list; } -let userconfig_of_json (json: Json.json): userconfig option = +let userconfig_of_json (json: Json.t): userconfig option = let open Json.Util in let external_reader = json |> member "external_reader" |