Table of Contents
brew install ghc
Return to ghc, Glorious Glasgow Haskell Compilation System, ghc Installation - Haskell installation, brew install, Cloud Monk's Development PC DevOps Automation via Ansible-Chocolatey-PowerShell-Homebrew-DNF-APT, choco install ghc
https://formulae.brew.sh/formula/ghc
https://www.haskell.org/ghc - GHC is a state-of-the-art, open source, Haskell compiler and interactive environment for the functional language Haskell.
macOS
brew search ghc
=⇒ Formulae
ghc ghc@8.6 ghcup ghq ghz grc shc ghc@8.10 ghc@8.8 gh ✔ ghi ghr gcc ✔
=⇒ Casks
ghdl
If you meant “ghc” specifically:
It was migrated from homebrew/cask to homebrew/core.
iMac ~ % brew install ghc
=⇒ Downloading https://ghcr.io/v2/homebrew/core/ghc/manifests/9.2.4
=⇒ Downloading https://ghcr.io/v2/homebrew/core/ghc/blobs/sha256:9958adc0fe9861
=⇒ Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh
=⇒ Pouring ghc–9.2.4.monterey.bottle.tar.gz
=⇒ /usr/local/Cellar/ghc/9.2.4/bin/ghc-pkg recache
🍺 /usr/local/Cellar/ghc/9.2.4: 7,752 files, 1.5GB
=⇒ Running `brew cleanup ghc`…
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
iMac ~ % ghc --version
The Glorious Glasgow Haskell Compilation System, version 9.2.4
iMac ~ % ghc --help
Usage:
ghc [command-line-options-and-input-files]
To compile and link a complete Haskell program, run the compiler like so:
ghc Main
where the module Main is in a file named Main.hs (or Main.lhs) in the current directory. The other modules in the program will be located and compiled automatically, and the linked program will be placed in the file `Main' (or `Main.exe' on Windows).
Alternatively, ghc can be used to compile files individually. Each input file is guided through (some of the) possible phases of a compilation:
- unlit: extract code from a "literate program" - hscpp: run code through the C pre-processor (if -cpp flag given) - hsc: run the Haskell compiler proper - gcc: run the C compiler (if compiling via C) - as: run the assembler - ld: run the linker
For each input file, the phase to START with is determined by the file's suffix:
- .lhs literate Haskell unlit - .hs plain Haskell ghc - .hc C from the Haskell compiler gcc - .c C not from the Haskell compiler gcc - .s assembly language as - other passed directly to the linker ld
The phase at which to STOP processing is determined by a command-line option:
-E stop after generating preprocessed, de-litted Haskell
(used in conjunction with -cpp) -C stop after generating C (.hc output) -S stop after generating assembler (.s output) -c stop after generating object files (.o output)
Other commonly-used options are:
-v[n] Control verbosity (n is 0--5, normal verbosity level is 1,
-v alone is equivalent to -v3)
-O An `optimising' package of compiler flags, for faster code
-prof Compile for cost-centre profiling
(add -fprof-auto for automagic cost-centres on all top-level functions)
-H14m Increase compiler's heap size (might make compilation
faster, especially on large source files).
-M Output Makefile rules recording the
dependencies of a list of Haskell files.
Given the above, here are some TYPICAL invocations of ghc:
# compile a Haskell module to a .o file, optimising: % ghc -c -O Foo.hs # link three .o files into an executable called "test": % ghc -o test Foo.o Bar.o Baz.o # compile a Haskell module to C (a .hc file), using a bigger heap: % ghc -C -H16m Foo.hs # compile Haskell-produced C (.hc) to assembly language: % ghc -S Foo.hc
The User's Guide has more information about GHC's *many* options. An online copy can be found here:
http://www.haskell.org/ghc/docs/latest/html/users_guide/
If you *really* want to see every option, then you can pass '–show-options' to the compiler.
Linux
Haskell: Haskell Fundamentals, Haskell Inventor - Haskell Language Designer: Lennart Augustsson, Paul Hudak, John Hughes, Simon Peyton Jones, John Launchbury, Erik Meijer, Philip Wadler in 1990 (see Conference on Functional Programming Languages and Computer Architecture (FPCA 1987); Haskell keywords, Haskell data structures - Haskell algorithms, Haskell syntax, Haskell OOP, Haskell compiler (ghc - Glorious Glasgow Haskell Compilation System), Haskell installation (brew install ghc, choco install ghc) Haskell IDEs, Haskell development tools, Haskell DevOps - Haskell SRE - Haskell CI/CD, Cloud Native Haskell - Haskell Microservices - Serverless Haskell, Haskell Security - Haskell DevSecOps, Haskell and databases, Haskell data science - Haskell DataOps, Haskell machine learning - Haskell DL, Haskell deep learning, Functional Haskell, Haskell concurrency - Haskell parallel programming - Async Haskell, Haskell and scientific computing, Haskell history, Haskell bibliography, Haskell courses, Haskell glossary, Haskell topics, Haskell courses, Haskell Standard Library, Haskell libraries, Haskell frameworks, Haskell scientific computing, Haskell research, Haskell GitHub, Written in Haskell, Haskell popularity, Haskell Awesome list, Haskell topics, Haskell Versions (navbar_haskell - see also navbar_haskell_standard_library, navbar_haskell_libraries, navbar_haskell_reserved_words, navbar_haskell_functional, navbar_haskell_concurrency)
Homebrew: Cloud Monk's Package Manager Book Homebrew Chapter, Cloud Monk's Development PC DevOps Automation via Ansible-Chocolatey-PowerShell-Homebrew-DNF-APT, Homebrew Glossary, Homebrew Fundamentals, Homebrew Inventor - Homebrew Designer: Mike McQuaid, Brew DevOps - Homebrew on macOS - macOS DevOps - MacOps, Homebrew on Linux - Linux DevOps - LinuxOps, Homebrew Automation, Idempotent, Refreshenv, Homebrew Topics, macOS Package Managers, Package managers, macOS Configuration Management, PowerShell on macOS Ansible on macOS, Chef on macOS, Puppet on macOS (navbar_brew - see also navbar_choco, navbar_package_manager)
© 1994 - 2024 Cloud Monk Losang Jinpa or Fair Use. Disclaimers
SYI LU SENG E MU CHYWE YE. NAN. WEI LA YE. WEI LA YE. SA WA HE.