view json.urs @ 19:875221eee987

Sql.lookup
author Adam Chlipala <adam@chlipala.net>
date Sat, 31 Dec 2011 15:49:54 -0500
parents 943410267fad
children 8de201d70b91
line wrap: on
line source
(** The JSON text-based serialization format *)

class json

val toJson : a ::: Type -> json a -> a -> string
val fromJson : a ::: Type -> json a -> string -> a

val mkJson : a ::: Type -> {ToJson : a -> string,
                            FromJson : string -> a * string} -> json a

val json_string : json string
val json_int : json int
val json_float : json float
val json_bool : json bool
val json_option : a ::: Type -> json a -> json (option a)
val json_list : a ::: Type -> json a -> json (list a)

val json_record : ts ::: {Type} -> folder ts -> $(map json ts) -> $(map (fn _ => string) ts) -> json $ts