To reproduce a working environment, from the repository root, do:
- Install the Haskell installer with ghcup:
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh
This will ask questions:- Answer
P
to update yourPATH
automatically. - Answer
Y
to install IDE tooling (haskell-language-server
). - Answer
N
to installstack
, since this project uses the simpler cabal build tool
- Answer
- Install the System requirements.
If you are on Linux, this is something like
sudo apt install build-essential curl libffi-dev etc..
(see the link for the exact list of packages to install). - Run
ghcup install ghc 9.4.7
and thenghcup set ghc 9.4.7
to set the expected compiler version. - Run
cabal build all
. This will take a while as this repository depends on a number of fat libraries. Brew some coffee meanwhile.
At this point, everything should be set to work on the command line, for example try:
cabal run -v0 TP4.hs
You should get as output:
pyEval "1 + 3" returned: 4
Now you can continue with the IDE configuration:
- Install vscode and the Haskell extension.
- Launch
vscode
from the terminal (code . &
), from this repository's root. Ifvscode
asks you to install the Haskell Language Server, say yes. - Happy Haskell hacking! To experiment, hack in one of the
TP*.hs
files; see the first line for how to execute them.