anchor.diff:        Set1 :: set(Element),
         Set2 :: set(Element).
   
  -is_disjoint(S1, S2) when map_size(S1) < map_size(S2) ->
  -    fold(fun (_, false) -> false;
  -	     (E, true) -> not is_element(E, S2)
  -	 end, true, S1);
  +is_disjoint(S1, S2) when map_size(S1) > map_size(S2) ->
  +    is_disjoint_1(S1, maps:iterator(S2));
   is_disjoint(S1, S2) ->
  -    fold(fun (_, false) -> false;
  -	     (E, true) -> not is_element(E, S1)
  -	 end, true, S2).
  +    is_disjoint_1(S2, maps:iterator(S1)).
  +
  +is_disjoint_1(Set, Iter) ->
  +    case maps:next(Iter) of
  +        {K, _, NextIter} ->
  +            case Set of
  +                #{K := _} -> false;
  +                #{} -> is_disjoint_1(Set, NextIter)
  +            end;
  +        none ->
  +            true
  +    end.
   
   %% subtract(Set1, Set2) -> Set.
   %%  Return all and only the elements of Set1 which are not also in
  
positive.code:       Set1 :: set(Element),
        Set2 :: set(Element).
  
  filter(F, D) ->
      maps:filter(fun(K,_) -> F(K) end, D).
  
negative.code:       Set1 :: set(Element),
        Set2 :: set(Element).
  
  is_subset(S1, S2) when map_size(S1) > map_size(S2) ->
      false;
  is_subset(S1, S2) ->
      is_subset_1(S2, maps:iterator(S1)).
  
  is_subset_1(Set, Iter) ->
      case maps:next(Iter) of
          {K, _, NextIter} ->
              case Set of
                  #{K := _} -> is_subset_1(Set, NextIter);
                  #{} -> false
              end;
          none ->
              true
      end.
  
  %% fold(Fun, Accumulator, Set) -> Accumulator.
  %%  Fold function Fun over all elements in Set and return Accumulator.
  