anchor.diff:  decode_type('REGISTER') -> register;
   decode_type('FLAG')     -> flag;
   decode_type('MAP')      -> map.
  +
  +%% @doc Encodes an atom type into the PB message equivalent, using the
  +%% pass mappings to convert module names into shortnames.
  +-spec encode_type(atom(), type_mappings()) -> atom().
  +encode_type(TypeOrMod, Mods) ->
  +    case lists:keyfind(TypeOrMod, 2, Mods) of
  +        {AtomType, TypeOrMod} ->
  +            encode_type(AtomType);
  +        false ->
  +            encode_type(TypeOrMod)
  +    end.
   
   %% @doc Encodes an atom type name into the PB message equivalent.
   -spec encode_type(atom()) -> atom().
  
positive.code:          encode_fetch_request/3,
           decode_fetch_response/1,
           encode_fetch_response/3,
           encode_update_request/4,
           encode_update_request/5,
           decode_operation/1,
           decode_update_response/3,
           encode_update_response/4
          ]).
  
  -import(riak_pb_kv_codec, [encode_quorum/1]).
  
negative.code: encode_op_type(remove)  -> 'REMOVE';
  encode_op_type(update)  -> 'UPDATE'.
  
  %% @doc Decodes a PB message type name into a module name according to
  %% the passed mappings.
  -spec decode_type(atom(), type_mappings()) -> atom().
  decode_type(PBType, Mods) ->
      AtomType = decode_type(PBType),
      proplists:get_value(AtomType, Mods, AtomType).
  
  %% @doc Decodes a PB message type name into an atom.
  -spec decode_type(atom()) -> atom().
  decode_type('COUNTER')  -> counter;
  