anchor.diff:      [$(, marshal_struct_signature(SubTypes, []), $)];
   marshal_signature(variant) ->
       "v";
  -marshal_signature(dict_entry) ->
  -    exit(todo);
  +marshal_signature({dict, KeyType, ValueType}) ->
  +    KeySig = marshal_signature(KeyType),
  +    ValueSig = marshal_signature(ValueType),
  +
  +    %% TODO check length(KeySig) == 1
  +
  +    [$a, ${, KeySig, ValueSig, $}];
   marshal_signature([]) ->
       "";
   marshal_signature([Type|R]) ->
  
positive.code: -module(dberl.marshaller).
  
  -import(error_logger).
  -import(file).
  -import(io).
  
negative.code: marshal(variant, Value, Pos) when is_integer(Value), Value < 0 ->
      marshal_int_variant(Value, Pos);
  marshal(variant, Value, Pos) when is_integer(Value), Value >= 0 ->
      marshal_uint_variant(Value, Pos);
  marshal(variant, Value, Pos) when is_tuple(Value) ->
      Type = infer_type(Value),
      marshal_variant(Type, Value, Pos).
  
  infer_type(Value) when is_binary(Value)->
      {array, byte};
  infer_type(true) ->
      boolean;
  infer_type(false) ->
      boolean;
  infer_type(Value) when is_integer(Value), Value < 0 ->
      infer_int(Value);
  infer_type(Value) when is_integer(Value), Value >= 0 ->
      infer_uint(Value);
  infer_type(Value) when is_tuple(Value) ->
      infer_struct(tuple_to_list(Value));
  
  %%     case is_dict(Value) of
  %% 	true ->
  %% 	    dict;
  %% 	false ->
  %% 	    infer_struct(tuple_to_list(Value))
  %%     end;
  infer_type(Value) when is_atom(Value)->
      string;
  infer_type(Value) when is_list(Value) ->
      %% FIXME check if it's a valid (UTF-8) string
      string.
  
  
  is_dict(D) ->
      case catch dict:to_list(D) of
        L when is_list(L) ->
          true;
        {'EXIT',_} ->
          false
      end.
  
  infer_struct(Values) ->
      {struct, infer_struct(Values, [])}.
  
  infer_struct([], Res) ->
      Res;
  infer_struct([Value|R], Res) ->
      infer_struct(R, Res ++ [infer_type(Value)]).
  
  infer_int(Value) when Value >= -32768 ->
      int16;
  infer_int(Value) when Value >= -4294967296 ->
      int32;
  infer_int(_Value) ->
      int64.
  
  infer_uint(Value) when Value < 32768 ->
      uint16;
  infer_uint(Value) when Value < 4294967296 ->
      uint32;
  infer_uint(_Value) ->
      uint64.
  
  
  marshal_int_variant(Value, Pos) when Value >= -32768 ->
  