System Grab Bag

View all TLDR pages from common (or from all pages)

ghc

The Glasgow Haskell Compiler. Compiles and links Haskell source files. More information: https://www.haskell.org/ghc.
  • Find and compile all modules in the current directory:
    ghc Main
  • Compile a single file:
    ghc {{file.hs}}
  • Compile using extra optimization:
    ghc -O {{file.hs}}
  • Stop compilation after generating object files (.o):
    ghc -c {{file.hs}}
  • Start a REPL (interactive shell):
    ghci
  • Evaluate a single expression:
    ghc -e {{expression}}

License and Disclaimer

The content on this page is copyright © 2014—present the tldr-pages team and contributors.
This page is used with permission under Creative Commons Attribution 4.0 International License.

While we do attempt to make sure content is accurate, there isn't a warranty of any kind.