anchor.diff:    */
     mergeAttrs = x: y: x // y;
   
  -  # Flip the order of the arguments of a binary function.
  +  /* Flip the order of the arguments of a binary function.
  +
  +     Example:
  +       flip concat [1] [2]
  +       => [ 2 1 ]
  +  */
     flip = f: a: b: f b a;
   
  -  # Apply function if argument is non-null
  +  /* Apply function if argument is non-null.
  +
  +     Example:
  +       mapNullable (x: x+1) null
  +       => null
  +       mapNullable (x: x+1) 22
  +       => 23
  +  */
     mapNullable = f: a: if isNull a then a else f a;
   
     # Pull in some builtins not included elsewhere.
  
positive.code:     isInt isFloat add sub lessThan
      seq deepSeq genericClosure;
  
    inherit (lib.strings) fileContents;
  
    release = fileContents ../.version;
    versionSuffix = let suffixFile = ../.version-suffix; in
      if pathExists suffixFile then fileContents suffixFile else "pre-git";
  
    # Return the Nixpkgs version number.
    version = release + versionSuffix;
  
    nixpkgsVersion = builtins.trace "`lib.nixpkgsVersion` is deprecated, use `lib.version` instead!" version;
  
    # Whether we're being called by nix-shell.
    inNixShell = builtins.getEnv "IN_NIX_SHELL" != "";
  
    # Return minimum/maximum of two numbers.
    min = x: y: if x < y then x else y;
  
negative.code:   warn = msg: builtins.trace "WARNING: ${msg}";
    info = msg: builtins.trace "INFO: ${msg}";
  
  
    ## Function annotations
  
    /* Add metadata about expected function arguments to a function.
       The metadata should match the format given by
       builtins.functionArgs, i.e. a set from expected argument to a bool
       representing whether that argument has a default or not.
       setFunctionArgs : (a → b) → Map String Bool → (a → b)
  
       This function is necessary because you can't dynamically create a
       function of the { a, b ? foo, ... }: format, but some facilities
       like callPackage expect to be able to query expected arguments.
    */
    setFunctionArgs = f: args:
      { # TODO: Should we add call-time "type" checking like built in?
        __functor = self: f;
        __functionArgs = args;
      };
  
    /* Extract the expected function arguments from a function.
       This works both with nix-native { a, b ? foo, ... }: style
       functions and functions with args set with 'setFunctionArgs'. It
       has the same return type and semantics as builtins.functionArgs.
       setFunctionArgs : (a → b) → Map String Bool.
    */
    functionArgs = f: f.__functionArgs or (builtins.functionArgs f);
  
    /* Check whether something is a function or something
       annotated with function args.
    */
    isFunction = f: builtins.isFunction f ||
      (f ? __functor && isFunction (f.__functor f));
  }
  