1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-23 16:42:08 +02:00
tldr/pages/common/ghc.md
2019-06-07 22:58:59 +01:00

29 lines
498 B
Markdown

# 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}}`
- Run Haskell interactive interpreter (REPL):
`ghci`
- Evaluate a single expression:
`ghc -e {{expression}}`