This repository hosts my notes and solutions to exercises in the book Haskell Programming from First Principles.
The only dependency is Stack. Once setup, Stack takes care of any Haskell package dependencies.
This repository is organized as a single Stack project as follows
.
├── benchmark/
├── ChangeLog.md
├── haskell-programming-from-first-principles.cabal
├── LICENSE
├── package.yaml
├── README.md
├── Setup.hs
├── src/
├── stack.yaml
└── test/
where src are solutions whose name follows the pattern
ChapterName/SectionName/ExerciseName.hs
test and benchmark are test and benchmark suites following the same naming convention.
All test suites can be discovered by hspec-discover. To run tests, simply do
stack testor
stack --fast testif you want avoid GHC optimization (hence faster).
Run
stack benchNever use the
--fastflag for benchmarks otherwise you will get wrong results.
Reference benchmark results are included in each benchmark file as block comment.