2016-05-05 02:22:26 +01:00
|
|
|
# ghc
|
|
|
|
|
2016-05-05 17:33:43 +01:00
|
|
|
> The Glasgow Haskell Compiler.
|
|
|
|
> Compiles and links Haskell source files.
|
2019-06-07 11:58:23 +01:00
|
|
|
> More information: <https://www.haskell.org/ghc>.
|
2016-05-05 02:22:26 +01:00
|
|
|
|
|
|
|
- Find and compile all modules in the current directory:
|
|
|
|
|
|
|
|
`ghc Main`
|
|
|
|
|
|
|
|
- Compile a single file:
|
|
|
|
|
|
|
|
`ghc {{file.hs}}`
|
|
|
|
|
2016-05-05 17:33:43 +01:00
|
|
|
- Compile using extra optimization:
|
2016-05-05 02:22:26 +01:00
|
|
|
|
|
|
|
`ghc -O {{file.hs}}`
|
|
|
|
|
2016-05-05 17:33:43 +01:00
|
|
|
- Stop compilation after generating object files (.o):
|
2016-05-05 02:22:26 +01:00
|
|
|
|
|
|
|
`ghc -c {{file.hs}}`
|
|
|
|
|
2021-09-12 15:03:27 +01:00
|
|
|
- Start a REPL (interactive shell):
|
2016-05-05 02:22:26 +01:00
|
|
|
|
|
|
|
`ghci`
|
2018-10-13 17:51:33 +01:00
|
|
|
|
|
|
|
- Evaluate a single expression:
|
|
|
|
|
|
|
|
`ghc -e {{expression}}`
|