anchor.diff:    mapRecordFlatten = f : r : map (attr: f attr (builtins.getAttr attr r) ) (attrNames r);
   
     # to be used with listToAttrs (_a_ttribute _v_alue)
  +  # TODO should be renamed to nv because niksnut has renamed the attribute attr to name
     av = name : value : { inherit name value; };
     # attribute set containing one attribute
  -  avs = attr : value : listToAttrs [ (av attr value) ];
  +  avs = name : value : listToAttrs [ (av name value) ];
     # adds / replaces an attribute of an attribute set
  -  setAttr = set : attr : v : set // (avs attr v);
  +  setAttr = set : name : v : set // (avs name v);
   
     id = x : x;
     # true if all/ at least one element(s) satisfy f
  
positive.code: 
    mergeAttrs = fold ( x : y : x // y) {};
  
    # returns atribute values as a list 
    flattenAttrs = set : map ( attr : builtins.getAttr attr set) (attrNames set);
    mapIf = cond : f :  fold ( x : l : if (cond x) then [(f x)] ++ l else l) [];
  
  # Marc 2nd proposal: (not everything has been tested in detail yet..)
             
    # calls chooseOptionsByFlags2 with some preprocessing
    # chooseOptionsByFlags2 returns an attribute set meant to be used to create new derivaitons.
    # see mkDerivationByConfiguration in all-packages.nix and the examples given below.
  
negative.code:         then getAttr (tail attrPath) default (builtins.getAttr attr e)
          else default;
      };
    #getAttr = attrPath: default: e: getAttrMap id;
  
    # the same as getAttr but if the element exists map the value using function f 
    # corresponds to the maybe function of haskell
    getAttrMap = f : attrPath : default : e :
      let {
        attr = head attrPath;
        body =
          if attrPath == [] then e
          else if builtins ? hasAttr && builtins.hasAttr attr e
          then f (getAttr (tail attrPath) default (builtins.getAttr attr e))
          else default;
      };
  
  
  
    # Filter a list using a predicate; that is, return a list containing
  