anchor.diff:          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
  
positive.code:   mapRecordFlatten = f : r : map (attr: f attr (builtins.getAttr attr r) ) (attrNames r);
  
    # to be used with listToAttrs (_a_ttribute _v_alue)
    av = name : value : { inherit name value; };
    # attribute set containing one attribute
    avs = attr : value : listToAttrs [ (av attr value) ];
    # adds / replaces an attribute of an attribute set
    setAttr = set : attr : v : set // (avs attr v);
  
    id = x : x;
    # true if all/ at least one element(s) satisfy f
  
negative.code:   # Return a singleton list or an empty list, depending on a boolean
    # value.  Useful when building lists with optional elements
    # (e.g. `++ optional (system == "i686-linux") flashplayer').
    optional = cond: elem: if (cond) then [elem] else [];
  
    whenFlip = x : cond : if (cond) then x else "";
  
      
    # Return a list of integers from `first' up to and including `last'.
  