view json.urs @ 10:763eb2f2aa5a

Record.mem
author Adam Chlipala <adam@chlipala.net>
date Thu, 03 Feb 2011 09:31:32 -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