anchor.diff:      let cCall t m x = J.Call (t, cString m, x)
       let cCallG l m x = cCall (J.Global l) m x
       let cCallE m x = cCallG ["WebSharper"; "Json"; "Encode"] m x
  +    let cCallD m x = cCallG ["WebSharper"; "Json"; "Decode"] m x
       let (|T|) (t: R.TypeDefinition) = t.FullName
       let (>>=) (m: Choice<E, string> as x) (f: E -> Choice<E, string>) =
           match m with
  
positive.code: 
          interface M.IMacro with
              member this.Translate(q, tr) =
                  raise (System.NotImplementedException())
  
  /// Serializes an object to JSON using the same readable format as Sitelets.
  /// For plain JSON stringification, see Json.Stringify.
  
negative.code:     module Funs =
          let id = J.Global ["WebSharper"; "Json"; "Encode"; "Id"]
  
      let rec encode call (t: T) =
          match t with
          | T.Array (t, 1) ->
              encode call t >>= fun e ->
              ok (call "Array" [e])
          | T.Array _ ->
              fail "JSON serialization for multidimensional arrays is not supported."
          | T.Concrete (T ("Microsoft.FSharp.Core.Unit"
                          |"System.Boolean"
                          |"System.SByte" | "System.Byte"
                          |"System.Int16" | "System.UInt16"
                          |"System.Int32" | "System.UInt32"
                          |"System.Int64" | "System.UInt64"
                          |"System.Single"| "System.Double"
                          |"System.Decimal"
                          |"System.String"), []) ->
              ok Funs.id
          | T.Concrete (T "Microsoft.FSharp.Collections.FSharpList`1", [t]) ->
              encode call t >>= fun e ->
              ok (call "List" [e])
          | T.Concrete (T "Microsoft.FSharp.Collections.FSharpSet`1", [t]) ->
              encode call t >>= fun e ->
              ok (call "Set" [e])
          | T.Concrete (T "Microsoft.FSharp.Collections.FSharpMap`2",
                          [T.Concrete (T "System.String", []); t]) ->
              encode call t >>= fun e ->
              ok (call "StringMap" [e])
          | T.Concrete (T "System.Collections.Generic.Dictionary`2",
                          [T.Concrete (T "System.String", []); t]) ->
              encode call t >>= fun e ->
              ok (call "StringDictionary" [e])
          | T.Concrete (T n, ts) when n.StartsWith "System.Tuple`" ->
              ((fun es -> ok (call "Tuple" [J.NewArray es])), ts)
              ||> List.fold (fun k t ->
                  fun es -> encode call t >>= fun e -> k (e :: es))
              <| []
          | t ->
              fail ("Type not supported for serialization: " + t.FullName)
  
      type SerializeMacro() =
  
          interface M.IMacro with
              member this.Translate(q, tr) =
                  match q with
                  // Serialize<'T> x
                  | Q.CallModule({Generics = [t]}, [x]) ->
                      match encode cCallE t with
                      | Choice1Of2 enc ->
                          cCallG ["JSON"] "stringify" [J.Application(enc, [tr x])]
                      | Choice2Of2 msg ->
  