anchor.diff:      readFile
       ;
   
  -  # Returns the type of a path: regular (for file), symlink, or directory
  -  pathType = p: getAttr (baseNameOf p) (readDir (dirOf p));
  -
  -  # Returns true if the path exists and is a directory, false otherwise
  -  pathIsDirectory = p: if pathExists p then (pathType p) == "directory" else false;
  -
  -  # Returns true if the path exists and is a regular file, false otherwise
  -  pathIsRegularFile = p: if pathExists p then (pathType p) == "regular" else false;
  -
  -  # Bring in a path as a source, filtering out all Subversion and CVS
  -  # directories, as well as backup files (*~).
  +  /*
  +    Returns the type of a path: regular (for file), symlink, or directory.
  +  */
  +  pathType = path: getAttr (baseNameOf path) (readDir (dirOf path));
  +
  +  /*
  +    Returns true if the path exists and is a directory, false otherwise.
  +  */
  +  pathIsDirectory = path: if pathExists path then (pathType path) == "directory" else false;
  +
  +  /*
  +    Returns true if the path exists and is a regular file, false otherwise.
  +  */
  +  pathIsRegularFile = path: if pathExists path then (pathType path) == "regular" else false;
  +
  +  /*
  +    A basic filter for `cleanSourceWith` that removes
  +    directories of version control system, backup files (*~)
  +    and some generated files.
  +  */
     cleanSourceFilter = name: type: let baseName = baseNameOf (toString name); in ! (
       # Filter out version control software files/directories
       (baseName == ".git" || type == "directory" && (baseName == ".svn" || baseName == "CVS" || baseName == ".hg")) ||
  
positive.code:         satisfiesSubpathInvariant = src ? satisfiesSubpathInvariant && src.satisfiesSubpathInvariant;
        };
  
    # Filter sources by a list of regular expressions.
    #
    # E.g. `src = sourceByRegex ./my-subproject [".*\.py$" "^database.sql$"]`
    sourceByRegex = src: regexes:
      let
        isFiltered = src ? _isLibCleanSourceWith;
  
negative.code: 
    pathIsGitRepo = path: (tryEval (commitIdFromGitRepo path)).success;
  
    /*
      Get the commit id of a git repo.
  
      Example: commitIdFromGitRepo <nixpkgs/.git>
    */
    commitIdFromGitRepo =
      let readCommitFromFile = file: path:
          let fileName       = toString path + "/" + file;
  