HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Moduleghc-toolchain-0.1.0.0Haskell2010

GHC.Toolchain.Program

  • 2 types
  • 15 values

Running programs

4 declarations

Finding Programs

6 declarations
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

2 declarations
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).