Noogλe

search input

Function of the day

  • The file set containing all files from the first file set that are not in the second file set. See also Difference (set theory).

    The given file sets are evaluated as lazily as possible, with the first argument being evaluated first if needed.

    Inputs

    positive

    The positive file set. The result can only contain files that are also in this file set. This argument can also be a path, which gets implicitly coerced to a file set.

    negative

    The negative file set. The result will never contain files that are also in this file set. This argument can also be a path, which gets implicitly coerced to a file set.

    Type

    difference :: FileSet -> FileSet -> FileSet
    

    Examples

    lib.fileset.difference usage example

    # Create a file set containing all files from the current directory,
    # except ones under ./tests
    difference ./. ./tests
    
    let
      # A set of Nix-related files
      nixFiles = unions [ ./default.nix ./nix ./tests/default.nix ];
    in
    # Create a file set containing all files under ./tests, except ones in `nixFiles`,
    # meaning only without ./tests/default.nix
    difference ./tests nixFiles