anchor.diff:  new(Attrs) ->
       Ts = proplists:get_value(ts, Attrs),
       Key = proplists:get_value(key, Attrs),
  -    #pvattrs{count = 1, timespan = {{Ts, Key}, {Ts, Key}}}.
  +    #pvattrs{count = 1, timespan = new_timespan({Ts, Key})}.
   
   add(#pvattrs{count=Count0, timespan=TSp0},
       #pvattrs{count=Count1, timespan=TSp1}) ->
  
positive.code: 
  -record(pvattrs,    % Per-Value Attributes
          { count     % integer
          , timespan  % {{TsMin, Key1}, {TsMax, Key2}}
          }).
  
  %% TODO maybe require a normalized form of Attrs here
  
negative.code: add(Attrs, #pvattrs{count=Count, timespan=TSp}) ->
      Ts = proplists:get_value(ts, Attrs),
      Key = proplists:get_value(key, Attrs),
      #pvattrs{count = Count+1, timespan = add_timespan({Ts, Key}, TSp)}.
  
  %% Since we can discriminate Attrs from #pvattrs{}, we use add/2 for joins too.
  %% This is useful in ds_sampler:join/2. Provide join/2 here as a simple alias.
  join(PVS0, PVS1) -> add(PVS0, PVS1).
  
  
  get_count(#pvattrs{count = Count}) -> Count.
  