This repo consists of exercises to learn Haskell and Functional Programming.
Currently it consists of exercises from Haskell CIS194
.
The project structure follows the normal convention:
src
contains the implementation of the exercises. E.g. theCIS194.Homework01.Exercise01
module.test
containsTasty.HSpec
specs of the exported functions from the modules insrc
.test/Spec.hs
is the test auto-discovery driver.scripts
contains useful shell scripts to be run in CI pipelines, docker containers and local environments.
- We try to follow the guideline from haskell.org in most cases, however we will also occasionally make some minor adjustment.
- Style check is done by
hlint
. - Code formatting is done by
stylish-haskell
.
To run the tests in the project, we need:
- Binary dependencies:
stylish-haskell
,hlint
,tasty-discover
,hpc-threshold
andstack-hpc-coveralls (CI only)
. - Library dependencies: see dependencies specified in
package.yaml
.
- To install the binary dependencies, run
stack install stylish-haskell hlint tasty-discover hpc-threshold
. - To install the library dependencies, run
stack build --test --only-dependencies
. - Run
./scripts/docker/style-check-and-unit-test.sh
.
- Before building the docker image, DO NOT FORGET to increase the docker daemon RAM to 8GB or more.
- To build the docker image, run
docker-compose build haskell
. - Run the style check and test
docker-compose run --rm haskell ./scripts/docker/style-check-and-unit-test.sh
. - Test coverage report will be included in the console output.