HORIZON HASKELLDocslts/ghc-10.0.x2b276322026-10-31Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 2b27632 · 2026-10-31

Moduleghc-toolchain-0.1.0.0Haskell2010

GHC.Toolchain.Program

Contents
  1. Running programs
  2. Finding Programs
  3. Compiler programs
Synopsis

Running programs

Finding Programs

valuefindProgram
  1. :: String
  2. -> ProgOpt

    path provided by user

  3. -> [FilePath]

    candidate names

  4. -> M Program

Tries to find the user specified program by path or tries to look for one in the given list of candidates.

If the ProgOpt program flags are unspecified the program will have an empty list of flags.

Compiler programs

valuecompile
  1. :: FilePath

    input extension

  2. -> [String]

    extra flags

  3. -> Lens compiler Program
  4. -> compiler
  5. -> FilePath

    output path

  6. -> String

    source

  7. -> M ()

Compile a program with a given compiler.

The compiler must * Take the program path as a positional argument * Accept -o to specify output path

valuesupportsTarget
  1. :: ArchOS
  2. -> Lens compiler Program
  3. -> (compiler -> M ())

    Action to check if compiler with --target flag works

  4. -> String

    The LLVM target to use if cc supports --target

  5. -> compiler

    The compiler to check --target support for

  6. -> M compiler

    Return compiler with --target flag if supported

Does compiler program support the --target=triple option? If so, we should pass it whenever possible to avoid ambiguity and potential compile-time errors (e.g. see #20162).