annotate tests/testJson.ur @ 0:63697ef80a2c
JSON, minus records and nulls
author |
Adam Chlipala <adam@chlipala.net> |
date |
Thu, 02 Dec 2010 11:10:57 -0500 |
parents |
|
children |
4d103b4450ee |
rev |
line source |
adam@0
|
1 fun main () : transaction page = return <xml><body>
|
adam@0
|
2 {[Json.toJson (1 :: 2 :: 8 :: [])]}<br/>
|
adam@0
|
3 {[Json.fromJson "[1,2, 8]" : list int]}
|
adam@0
|
4 <hr/>
|
adam@0
|
5 {[Json.toJson (1.2 :: 2.4 :: (-8.8) :: [])]}<br/>
|
adam@0
|
6 {[Json.fromJson "[1.4,-2.7, 8.215506]" : list float]}
|
adam@0
|
7 <hr/>
|
adam@0
|
8 {[Json.toJson ("hi" :: "bye" :: "tricky\\\" one!" :: [])]}<br/>
|
adam@0
|
9 {[Json.fromJson "[\"abc\", \"\\\\whoa\"]" : list string]}
|
adam@0
|
10 <hr/>
|
adam@0
|
11 {[Json.toJson (True :: False :: True :: [])]}<br/>
|
adam@0
|
12 {[Json.fromJson "[true,false, true]" : list bool]}
|
adam@0
|
13 </body></xml>
|