summaryrefslogtreecommitdiff
path: root/src/Identifiers.ml
diff options
context:
space:
mode:
authorSon Ho2021-11-17 16:30:57 +0100
committerSon Ho2021-11-17 16:30:57 +0100
commitdabf9836f8bf59d4590e4bef126299492c9b53de (patch)
tree15b01173bbd98f1baad08e8c11a6eae5ce758345 /src/Identifiers.ml
parent2903cd956575624313d29e1a3ecd1abcbaab4dc3 (diff)
Start implementing by hand the json deserializers
Diffstat (limited to 'src/Identifiers.ml')
-rw-r--r--src/Identifiers.ml11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/Identifiers.ml b/src/Identifiers.ml
index 27ed2921..1b9e114c 100644
--- a/src/Identifiers.ml
+++ b/src/Identifiers.ml
@@ -19,6 +19,8 @@ module type Id = sig
val id_of_yojson : Yojson.Safe.t -> (id, string) Result.result
+ val id_of_json : Yojson.Safe.t -> (id, string) Result.result
+
val id_to_yojson : id -> Yojson.Safe.t
val vector_of_yojson :
@@ -26,6 +28,11 @@ module type Id = sig
Yojson.Safe.t ->
('a vector, string) Result.result
+ val vector_of_json :
+ (Yojson.Safe.t -> ('a, string) Result.result) ->
+ Yojson.Safe.t ->
+ ('a vector, string) Result.result
+
val vector_to_yojson : ('a -> Yojson.Safe.t) -> 'a vector -> Yojson.Safe.t
(* TODO: remove *)
@@ -52,6 +59,10 @@ module IdGen () : Id = struct
let to_string = string_of_int
+ let id_of_json = id_of_yojson
+
+ let vector_of_json = vector_of_yojson
+
(* TODO: how to make this work? *)
(* (module Ord : Map.OrderedType = struct
type t = id