anchor.diff:  % TODO: error case for imcomplete format when short for any type formats.
   -spec unpack( binary() )->
       {msgpack_term(), binary()} | {more, non_neg_integer()} | {error, reason()}.
  -unpack(Bin) when not is_binary(Bin)->
  -    {error, badarg};
  -unpack(Bin) when bit_size(Bin) >= 8 ->
  -    << Flag:8/unsigned-integer, Payload/binary >> = Bin,
  -    unpack_(Flag, Payload);
  -unpack(<<>>)-> % when bit_size(Bin) < 8 ->
  -    {more, 1}.
  +unpack(Bin) ->
  +    unpack_(Bin).
   
   -spec unpack_all( binary() ) -> [msgpack_term()].
   unpack_all(Data)->
  
positive.code:     end.
  
  % list / tuple
  pack_array(L) when is_list(L)->
      case length(L) of
   	Len when Len < 16 ->
   	    << 2#1001:4, Len:4/integer-unit:1, (pack_array_(L, <<>>))/binary >>;
  	Len when Len < 16#10000 -> % 65536
  	    << 16#DC:8, Len:16/big-unsigned-integer-unit:1,(pack_array_(L, <<>>))/binary >>;
  	Len ->
  	    << 16#DD:8, Len:32/big-unsigned-integer-unit:1,(pack_array_(L, <<>>))/binary >>
      end.
  pack_array_([], Acc) -> Acc;
  pack_array_([Head|Tail], Acc) ->
      pack_array_(Tail, <<Acc/binary,  (pack(Head))/binary>>).
  
  % FIXME! this should be tail-recursive and without lists:reverse/1
  unpack_array_(<<>>, 0, RetList)   -> {lists:reverse(RetList), <<>>};
  unpack_array_(Remain, 0, RetList) when is_binary(Remain)-> {lists:reverse(RetList), Remain};
  unpack_array_(<<>>, RestLen, _RetList) when RestLen > 0 ->  {more, RestLen};
  unpack_array_(Bin, RestLen, RetList) when is_binary(Bin)->
      case unpack(Bin) of
  	{more, Len} -> {more, Len+RestLen-1};
  	{Term, Rest}-> unpack_array_(Rest, RestLen-1, [Term|RetList])
  
negative.code:     pack_map_(Tail, << Acc/binary, (pack(Key))/binary, (pack(Value))/binary>>).
  
  % 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) -> {{lists:reverse(Acc)}, Bin};
  unpack_map_(Bin, Len, Acc) ->
      case unpack(Bin) of
  	{ more, MoreLen } -> { more, MoreLen+Len-1 };
  	{ Key, Rest } ->
  