anchor.diff:  
   
   %% ==== Operations ====
  -
  -%% @doc Adds a key to the map, inserting the empty value for its type.
  -%% Adding a key that already exists in the map has no effect. If the
  -%% key has been previously removed from the map, the removal will be
  -%% discarded, but no explicit add will be recorded.
  --spec add(key(), map()) -> map().
  -add(Key, #map{value=V, updates=U, adds=A, removes=R}=M) ->
  -    case {orddict:is_key(Key, U), ordsets:is_element(Key, R)} of
  -        %% It is already in the updates, do nothing.
  -        {true, _} ->
  -            M;
  -        %% It was previously removed, clear that removal.
  -        {false, true} ->
  -            M#map{removes=ordsets:del_element(Key, R)};
  -        %% It is brand new, record the add and store a value in the
  -        %% updates. If it was in the original value, initialize it
  -        %% with that.
  -        {false, false} ->
  -            Value = find_or_new(Key, V),
  -            M#map{adds=ordsets:add_element(Key, A),
  -                  updates=orddict:store(Key, Value, U)}
  -    end.
   
   %% @doc Removes a key and its value from the map. Removing a key that
   %% does not exist simply records a remove operation. Removing a key
  
positive.code: %% @doc Extracts an operation from the map that can be encoded into an
  %% update request.
  -spec to_op(map()) -> riakc_datatype:update(map_op()).
  to_op(#map{updates=U, adds=A, removes=R, context=C}) ->
      Updates = [ {add, Key} || Key <- A ] ++
          [ {remove, Key} || Key <- R ] ++
           orddict:fold(fun fold_extract_op/3, [], U),
      case Updates of
          [] -> undefined;
          _ ->
  
negative.code: 
  gen_op() ->
      oneof([
             {erase, [gen_key()]},
             ?LAZY({update, ?LET({_,T}=Key, gen_key(), [Key,
                                                        gen_update_fun(T)])})
  