anchor.diff:  
   
       
  +% Based on Misra-Gries' Frequent algorithm.
  +    
   -spec frequent_new( type:natural() ) -> #stream_frequent{}.
   
  -frequent_new(K)
  -        when K > 1  ->
  +frequent_new(K) when K > 1  ->
       #stream_frequent{ k = K, n = 0 }. 
       
       
   frequent_push( X
  -             , #stream_frequent{ k = K, n = N
  -                               , data = Data }) ->
  +             , #stream_frequent{ k = K, n = N, data = Data }) ->
       Sz = maps:size(Data),
       case maps:get(X, Data, undefined) of
           undefined when Sz < K - 1   ->
  
positive.code:     
                             
  minmax_push( X
             , #stream_minmax{ min = Min
                             , max = Max })
          when X < Min  ->
      #stream_minmax{ min = X, max = Max };
          
          
  minmax_push( X
             , #stream_minmax{ min = Min
                             , max = Max })
          when X > Max  ->
      #stream_minmax{ min = Min, max = X };
          
  
negative.code: -export([ sample_new/1, sample_push/2, sample_values/1
          , sample_test/0]).
  -export([ minmax_new/0, minmax_push/2, minmax_values/1]).
  -export([ fold_new/2, fold_push/2, fold_values/1]).
  -export([ frequent_new/1, frequent_push/2, frequent_values/1]).
          
  
  