anchor.diff:      ) (attrNames distribution))
     ;
     
  -  filterDistributionMapAttributes = {distribution, services, infrastructure, serviceProperty, targetProperty}:
  +  mapAttrOnAttr = {distribution, services, infrastructure, serviceProperty, targetProperty}:
       listToAttrs (map (serviceName:
         { name = serviceName;
           value =
  
positive.code: {lib}:
  
  rec {
    inherit (builtins) listToAttrs attrNames getAttr;
    inherit (lib) filter elem;
  
    filterDerivations = services:
  
negative.code:       }
      ) (attrNames distribution))
    ;
    
    mapStatefulToPrevious = {services, distribution, previousDistribution}:
      listToAttrs (map (serviceName:
        { name = serviceName;
          value =
            let
              service = getAttr serviceName services;
  	    targets = getAttr serviceName distribution;
  	    previousTargets = if hasAttr serviceName previousDistribution then getAttr serviceName previousDistribution
  	                      else targets;
            in
            if service ? stateful && service.stateful then
  	    filter (targetName: elem targetName previousTargets) targets
  	  else targets;
        }
      ) (attrNames distribution))
    ;
  }
  