def _output_arguments(dirs, generate_code = True):
    """The command-line arguments controlling GHC outputs."""
    return [
        "-no-link",
        "-hidir",
        dirs.hi.path,
        "-odir",
        dirs.object.path,
        "-stubdir",
        dirs.stub.path,
        "-ddump-to-file",
        # Write output files as:
        # path/to/target.dump/dump-simpl
        "-dumpdir",
        dirs.dump.path,
        "-ddump-file-prefix",
        # No prefix leads to a simpler output path:  "path/to/target.dump/dump-simpl"
        "",
    ] + (
        # Also write interface files when not generating code, even though we're not using them yet.
        # If -fwrite-interface wasn't set, GHC would still write the .hi files to a temporary
        # location: https://gitlab.haskell.org/ghc/ghc/issues/16670
        # Keeping them gives the HaskellCheck action some nontrivial output.
        [] if generate_code else ["-fno-code", "-fwrite-interface"]
    ) + (
        # Builds a directory with a ".mix" extension containing all of the .mix
        # files generated by GHC when HPC is enabled
        # (https://wiki.haskell.org/Haskell_program_coverage).
        ["-fhpc", "-hpcdir", dirs.mix.path] if dirs.mix else []
    )