Files
tldr/pages.zh/common/ghc.md

29 lines
501 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# ghc
> 格拉斯哥哈斯克尔编译器。
> 编译和链接哈斯克尔源文件。
> 更多信息:<https://www.haskell.org/ghc>。
- 查找并编译当前目录中的所有模块:
`ghc Main`
- 编译单个文件:
`ghc {{path/to/file.hs}}`
- 使用额外优化进行编译:
`ghc -O {{path/to/file.hs}}`
- 在生成目标文件(.o后停止编译
`ghc -c {{path/to/file.hs}}`
- 启动 REPL交互式 shell
`ghci`
- 评估单个表达式:
`ghc -e {{expression}}`