anchor.diff:          1 -> breach_upper;
           2 -> breach_lower;
           3 -> ok
  -    end;
  -check_alarm(_, _) ->
  -    unknown_alarm_handler.
  +    end.
   
   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   % alarm helpers
  
positive.code: 
  -export([start_link/1, init/1, on/2]).
  
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  % types
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  
negative.code: continue_alarm(Name, Secs, Pid, Epoch) ->
      msg_delay:send_local(Secs, Pid, {check_alarm, Name, Epoch}).
  
  -spec update_alarm(dict(), atom(), {atom(), any()} | [{atom(), any()}]) -> dict().
  update_alarm(Alarms, Name, {Field, NewValue}) ->
      update_alarm(Alarms, Name, [{Field, NewValue}]);
  update_alarm(Alarms, Name, [{Field, NewValue}|Tail]) ->
      UpdateFun = ?IIF(Field =:= epoch,
                       fun({_Alarm, _Epoch}) -> {_Alarm, NewValue} end,
                       fun({Alarm, Epoch}) -> {erlang:setelement(10, Alarm, NewValue), Epoch} end
                  ),
      NewAlarms = dict:update(Name, UpdateFun, Alarms),
      update_alarm(NewAlarms, Name, Tail);
  update_alarm(Alarms, _Name, []) ->
      Alarms.
  