Linux command
ghcup 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Install GHC version
ghcup install ghc [9.4.7]
Install latest GHC
ghcup install ghc
Set default GHC
ghcup set ghc [9.4.7]
Install Cabal
ghcup install cabal
Install HLS
ghcup install hls
List available and installed tools
ghcup list
Remove a GHC version
ghcup rm ghc [9.4.7]
Interactive TUI
ghcup tui
Upgrade ghcup itself
ghcup upgrade
说明
ghcup is the universal installer and version manager for the Haskell toolchain. It provides a centralized way to install, manage, and switch between multiple versions of GHC, Cabal, Stack, and HLS (Haskell Language Server). The tool handles downloading, installing, and setting up PATH entries for all Haskell development tools. It supports installing specific versions, setting global defaults, and maintaining multiple versions side-by-side. The interactive TUI mode provides a visual interface for managing installations.
参数
- ghc
- Glasgow Haskell Compiler.
- cabal
- Cabal build tool.
- hls
- Haskell Language Server.
- stack
- Stack build tool.
FAQ
What is the ghcup command used for?
ghcup is the universal installer and version manager for the Haskell toolchain. It provides a centralized way to install, manage, and switch between multiple versions of GHC, Cabal, Stack, and HLS (Haskell Language Server). The tool handles downloading, installing, and setting up PATH entries for all Haskell development tools. It supports installing specific versions, setting global defaults, and maintaining multiple versions side-by-side. The interactive TUI mode provides a visual interface for managing installations.
How do I run a basic ghcup example?
Run `ghcup install ghc [9.4.7]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does ghc do in ghcup?
Glasgow Haskell Compiler.