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.
|
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}}`
|
|
|
|
|
2016-05-05 17:33:43 +01:00
|
|
|
- Run Haskell interactive interpreter (REPL):
|
2016-05-05 02:22:26 +01:00
|
|
|
|
|
|
|
`ghci`
|