Noogλe

search input

Function of the day

  • The file set containing all files that are in any of the given file sets. This is the same as union, but takes a list of file sets instead of just two. See also Union (set theory).

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

    Inputs

    filesets

    A list of file sets. The elements can also be paths, which get implicitly coerced to file sets.

    Type

    unions :: [ FileSet ] -> FileSet
    

    Examples

    lib.fileset.unions usage example

    # Create a file set containing selected files
    unions [
      # Include the single file `Makefile` in the current directory
      # This errors if the file doesn't exist
      ./Makefile
    
      # Recursively include all files in the `src/code` directory
      # If this directory is empty this has no effect
      ./src/code
    
      # Include the files `run.sh` and `unit.c` from the `tests` directory
      ./tests/run.sh
      ./tests/unit.c
    
      # Include the `LICENSE` file from the parent directory
      ../LICENSE
    ]