Cabal is a system for building and packaging Haskell libraries and programs. It defines a common interface for package authors and distributors to easily build their applications in a portable way. Cabal is part of a larger infrastructure for distributing, organizing, and cataloging Haskell libraries and programs.
The term cabal can refer to either: cabal-the-spec (.cabal files), cabal-the-library (code that understands .cabal files), or cabal-the-tool (the cabal-install package which provides the cabal executable); usually folks are referring to cabal-the-tool when they say cabal.
The recommended method to install the cabal executable is to use ghcup, which can manage multiple versions of cabal on Linux, Mac and Windows. Alternatively, you can install cabal using your distribution's package manager (if you are using Linux or Mac), or download the source or prebuilt binary from the Download page.
If you have installed cabal using ghcup,
then you can also upgrade it using ghcup.
If you installed the cabal executable using a different method,
you can upgrade it by running:
cabal install cabal-install
This will install the cabal executable in cabal's installdir
(usually ~/.local/bin). In order to use this executable,
you have to make sure that this directory appears in the $PATH
variable before the location where your current cabal executable is located.
You can check which version of the cabal executable
you are running by executing the command below.
cabal --version
If the update failed for any reason, see the Update Troubleshooting section below.
Start by installing the cabal executable (see the previous section) and the Haskell compiler ghc. It is also recommended to use ghcup to install ghc.
mkdir myproject && cd myproject
cabal init
cabal run
Before you try anything else, you may want to refresh the package index:
cabal update
If you already have a new-ish version of cabal
you can use the v2/new commands. Try the following:
cabal new-install Cabal cabal-install
If this works, update the cabal command on
your $PATH with the version installed.
Some alternative installation methods from source code are described
in the Cabal source repository.
Particularly when upgrading from old versions, you may see:
ERROR: cabal: The following packages are likely to be broken by the reinstalls: ...
Use --force-reinstalls if you want to install anyway.
This can happen if your package archive gets into a broken state. How to fix this depends on the situation. Sometimes re-running the command with --force-reinstalls works, other times you have to remove your whole package archive and start over again.
Thankfully this doesn't happen very often. If you run into this issue and you want to preserve your local package archive, ask a question, e.g., on StackOverflow.
手指发红是什么原因 | 梦见白事场面什么意思 | 蛋白电泳是查什么的 | 贱货是什么意思 | abo溶血症是什么 |
孩子爱流鼻血是什么原因 | 江苏有什么烟 | 小白脸是什么意思 | 妈妈吃什么帮宝宝排气 | 足是什么结构 |
抽筋是什么原因引起的 | 卦不走空是什么意思 | 网剧是什么意思 | 烤乳猪用的是什么猪 | 刘备和刘邦什么关系 |
宫腔内异常回声是什么意思 | dsa什么意思 | 口是心非是什么生肖 | 女人吃什么补充雌激素 | 高考什么时候恢复 |
过敏性紫癜看什么科hcv7jop9ns6r.cn | 什么是厌食症hcv8jop3ns4r.cn | 多囊卵巢综合症有什么症状hcv8jop9ns4r.cn | 什么工作最赚钱hcv8jop9ns0r.cn | 脑梗有什么症状前兆hcv9jop2ns0r.cn |
梦见被熊追是什么意思hcv9jop4ns0r.cn | 舌苔厚白湿气重吃什么药hcv9jop1ns8r.cn | 望尘莫及的及是什么意思hcv9jop6ns4r.cn | 赵云的坐骑是什么马inbungee.com | 脚浮肿是什么原因引起的hcv8jop8ns8r.cn |
1991年是什么年hcv7jop7ns3r.cn | 乳腺结节是什么病hcv7jop9ns9r.cn | 中医五行属什么hcv9jop4ns0r.cn | 子时是什么时间hcv9jop4ns3r.cn | 湿气太重吃什么好hcv9jop4ns3r.cn |
红眼病什么症状hcv9jop7ns1r.cn | 甲状腺欠均匀什么意思hcv9jop1ns1r.cn | 吃了狗肉不能吃什么cl108k.com | 牙龈出血吃什么药hcv9jop2ns7r.cn | 右手有点麻是什么原因huizhijixie.com |