just a simple guide for getting started with cabal.Tweet
Download Cabal and cabal-install
You'll need at least this version
cabal-install version 126.96.36.199
using version 188.8.131.52 of the Cabal library
create a new directory, open it and type
cabal sandbox init
to create a new sandbox in a subdirectory
of your current folder
update your local list of packages and dependencies, with
this will get the newest versions listed on Hackage
create a copy of a package by running the command
Some flags can speed up this process
-jN to build N packages in parallel
--dry-run to see what cabal plans to do (recommended)
your sandbox consists of specific local version of packages you've just added and your project can be built with
you can find your executables in
Introduced in Cabal version 1.20
is useful when building an application.
It produces a list of packages with their version numbers.
You can play around with the code in GHCi:
This is much faster than rebuilding the executable
after every single change.
It is a ghci console, where you can
:r reload the file.
Sometimes different versions can cause build errors.
List all the registered packages:
In special cases when you want to unregister specific packages:
ghc-pkg unregister packageName-0.0.1
attaching patched or an unreleased version of a library
cabal sandbox add-source
cabal sandbox delete
alternative manual clean
rm -rf .cabal-sandbox cabal.sandbox.config