view json.urs @ 1:4d103b4450ee

Converted a record to JSON
author Adam Chlipala <adam@chlipala.net>
date Thu, 02 Dec 2010 11:35:01 -0500
parents 63697ef80a2c
children 8f7396495045
line wrap: on
line source
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_list : a ::: Type -> json a -> json (list a)

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