← 返回命令列表

Linux command

cabal 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Build

cabal build

Run

cabal run

Install

cabal install [package]

Create

cabal init

Test

cabal test

Update

cabal update

说明

cabal (Common Architecture for Building Applications and Libraries) is the package manager and build system for Haskell. It handles dependency resolution, building, testing, and distributing Haskell packages. Cabal uses Nix-style local builds by default, isolating dependencies per project to avoid conflicts.

参数

build
Build project
run _target_
Build and run executable
install _package_
Install package
update
Update package index
test
Run test suite
repl
Start GHCi with project loaded
clean
Remove build artifacts
sdist
Create source distribution
init
Create a new Cabal package interactively
bench
Run benchmarks
haddock
Build Haddock documentation
upload
Upload package to Hackage
freeze
Freeze dependencies to exact versions
outdated
Check for outdated dependencies

FAQ

What is the cabal command used for?

cabal (Common Architecture for Building Applications and Libraries) is the package manager and build system for Haskell. It handles dependency resolution, building, testing, and distributing Haskell packages. Cabal uses Nix-style local builds by default, isolating dependencies per project to avoid conflicts.

How do I run a basic cabal example?

Run `cabal build` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does build do in cabal?

Build project