Forrest logo
tool overview
On this page you find all important commands for the CLI tool ghc. If the command you are looking for is missing please ask our AI.

ghc

ghc is the command-line interface for the Glasgow Haskell Compiler (GHC). It is the most widely used compiler for the Haskell programming language. GHC supports various Haskell language extensions and provides a number of advanced features, making it a powerful tool for building and optimizing Haskell programs.

When invoked, ghc reads Haskell source code files and compiles them into executable binaries or object files. It performs various stages of compilation, including parsing, type checking, optimization, and code generation. ghc provides a range of options to control the compilation process, such as enabling specific language extensions, specifying optimization levels, and linking with external libraries.

In addition to compiling Haskell programs, ghc also offers other functionalities. It can generate standalone documentation for Haskell libraries using Haddock, a documentation generation tool. ghc can also run Haskell programs directly from the command line, which is useful for quick testing and prototyping.

Furthermore, ghc provides a REPL (Read-Eval-Print Loop) called GHCi. GHCi allows interactive development and evaluation of Haskell expressions, providing a way to experiment and explore the language interactively.

Overall, ghc is a versatile command-line tool that enables developers to compile, optimize, and interactively work with Haskell source code, making it an essential component for Haskell programming.

List of commands for ghc:

tool overview