annotate 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 |
rev |
line source |
adam@0
|
1 class json
|
adam@0
|
2
|
adam@0
|
3 val toJson : a ::: Type -> json a -> a -> string
|
adam@0
|
4 val fromJson : a ::: Type -> json a -> string -> a
|
adam@0
|
5
|
adam@0
|
6 val mkJson : a ::: Type -> {ToJson : a -> string,
|
adam@0
|
7 FromJson : string -> a * string} -> json a
|
adam@0
|
8
|
adam@0
|
9 val json_string : json string
|
adam@0
|
10 val json_int : json int
|
adam@0
|
11 val json_float : json float
|
adam@0
|
12 val json_bool : json bool
|
adam@0
|
13 val json_list : a ::: Type -> json a -> json (list a)
|
adam@1
|
14
|
adam@1
|
15 val json_record : ts ::: {Type} -> folder ts -> $(map json ts) -> $(map (fn _ => string) ts) -> json $ts
|