summaryrefslogtreecommitdiff
path: root/lib/ur/json.urs
diff options
context:
space:
mode:
authorGravatar Benjamin Barenblat <bbaren@mit.edu>2020-05-31 18:29:03 -0400
committerGravatar Benjamin Barenblat <bbaren@mit.edu>2020-05-31 18:29:03 -0400
commit6cc104634ef64be3be88c1fccbe98208d95d8a1a (patch)
tree9001e5333e808808125978a52669a8bff3639438 /lib/ur/json.urs
parent82fde07cef0e41b700b9a30137562eb05f2f2c6d (diff)
parentc2f1e1096f602b1cbd4531352f3e1ea6d656a186 (diff)
Merge branch 'dfsg_clean'
Diffstat (limited to 'lib/ur/json.urs')
-rw-r--r--lib/ur/json.urs10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/ur/json.urs b/lib/ur/json.urs
index b4bd6350..ad49a40f 100644
--- a/lib/ur/json.urs
+++ b/lib/ur/json.urs
@@ -13,10 +13,20 @@ val json_string : json string
val json_int : json int
val json_float : json float
val json_bool : json bool
+val json_time : json time
val json_option : a ::: Type -> json a -> json (option a)
val json_list : a ::: Type -> json a -> json (list a)
+(* By the way, time formatting follows RFC 3339, and we expose the more
+ * primitive formatting functions here. *)
+val rfc3339_out : time -> string
+val rfc3339_in : string -> time
+
val json_record : ts ::: {Type} -> folder ts -> $(map json ts) -> $(map (fn _ => string) ts) -> json $ts
+val json_record_withOptional : ts ::: {Type} -> ots ::: {Type} -> [ts ~ ots]
+ => folder ts -> $(map json ts) -> $(map (fn _ => string) ts)
+ -> folder ots -> $(map json ots) -> $(map (fn _ => string) ots)
+ -> json $(ts ++ map option ots)
val json_variant : ts ::: {Type} -> folder ts -> $(map json ts) -> $(map (fn _ => string) ts) -> json (variant ts)
val json_unit : json unit