anchor.diff:  % erl> S = <some term>.
   % erl> {S, <<>>} = msgpack:unpack( msgpack:pack(S) ).
   -type reason() ::  enomem | badarg | no_code_matches.
  --type map() :: any(). % there's no 'dict' type...
  --type msgpack_term() :: [msgpack_term()] | integer() | float() | {dict, map()}.
  +-type msgpack_term() :: [msgpack_term()] | {[{msgpack_term(),msgpack_term()}]} | integer() | float().
   
   % ===== external APIs ===== %
   -spec pack(Term::msgpack_term()) -> binary().
  
positive.code:     pack_raw(Bin);
  pack(List)  when is_list(List) ->
      pack_array(List);
  pack(Map) when is_tuple(Map), element(1,Map)=:=dict ->
      pack_map(Map);
  pack(_O) ->
      {error, undefined}.
  
  
negative.code: % FIXME: write test for unpack_map/1
  -spec unpack_map_(binary(), non_neg_integer(), [{term(), msgpack_term()}])->
      {more, non_neg_integer()} | { any(), binary()}.
  unpack_map_(Bin,  0,  Acc) when is_binary(Bin) -> {{lists:reverse(Acc)}, Bin};
  unpack_map_(Bin, Len, Acc) when is_binary(Bin) and is_integer(Len) ->
      case unpack(Bin) of
  	{ more, MoreLen } -> { more, MoreLen+Len-1 };
  	{ Key, Rest } ->
  	    case unpack(Rest) of
  		{more, MoreLen} -> { more, MoreLen+Len-1 };
  		{ Value, Rest2 } ->
  		    unpack_map_(Rest2,Len-1,[{Key,Value}|Acc])
  	    end
      end.
  
  