anchor.diff:  
   %% @doc Applies an operation to a snapshot of a crdt.
   %%      This function yields an error if the crdt does not have a corresponding update operation.
  --spec update_snapshot(type(), snapshot(), op()) -> {ok, snapshot()} | {error, reason()}.
  +-spec update_snapshot(type(), snapshot(), op()) -> {ok, snapshot()} | {error, {unexpected_operation, op(), type()}}.
   update_snapshot(Type, Snapshot, Op) ->
       try
           Type:update(Op, Snapshot)
       catch
           _:_ ->
  -            {error, unexpected_format}
  +            {error, {unexpected_operation, Op, Type}}
       end.
   
   %% @doc Applies updates in given order without any checks, errors are simply propagated.
  --spec materialize_eager(type(), snapshot(), [op()]) -> snapshot() | {error, reason()}.
  +-spec materialize_eager(type(), snapshot(), [op()]) -> snapshot() | {error, {unexpected_operation, op(), type()}}.
   materialize_eager(_Type, Snapshot, []) ->
       Snapshot;
   materialize_eager(Type, Snapshot, [Op | Rest]) ->
  
positive.code: 
  
  %% @doc Check that in a list of operations, all of them are correctly typed.
  -spec check_operations(list()) -> ok | {error, {type_check, term()}}.
  check_operations([]) ->
      ok;
  check_operations([Op | Rest]) ->
  
negative.code:     end.
  
  %% @doc Check that an operation is correctly typed.
  -spec check_operation(op()) -> boolean().
  check_operation(Op) ->
      case Op of
          {update, {_, Type, Update}} ->
              antidote_crdt:is_type(Type) andalso
                  Type:is_operation(Update);
          {read, {_, Type}} ->
              antidote_crdt:is_type(Type);
          _ ->
              false
      end.
  