Haskell: Package management


Usually done with cabal or stack.

cabal

https://cabal.readthedocs.io/en/latest/cabal-commands.html

Example use:

cabal init -i
# Edit <name>.cabal:
#  - include dependencies in build-depends (seperated by commas)
cabal build

Install an executable tool

cabal install --install-method=copy <package-name>

The executable will be at ~/.cabal/bin/

Eg:

cabal install --install-method=copy pandoc
# Executable would be at ~/.cabal/bin/pandoc

Tests

See:

New package example

cabal init
cabal update
cabal configure
cabal install
cabal build
cabal exec ghci