Chapter One: Setup
GHC (the main Haskell compiler) has a number of "language extensions" available. These are things that are available in GHC, but not yet in the language spec (which is updated every 10 years or so). These are primarily to modernize to the lanaguge, and make your life much easier. For reference, here's the list of extension that we have enabled standard.
Wow, that looks like a long list! Most of these enable quality-of-life improvements with new syntax or remove boilerplate. Almost all of these are used widely in industry, and are considered totally safe to use (and in some cases, it's masochistic to not have them enabled, like
OverloadedStrings). You can read up more on these at the extremely informative What I Wish I Knew When Learning Haskell.
We mention this here becasue you may find reference to them while on Stack Overflow, or some syntax that's not available in older references like the now woefully out-of-date Learn You a Haskell for Great Good (which I'm not even going to link).
A project is broken into a reusable library, executables, tests, and benchmarks.
You will often see library code in a
/srcdirectory. We're following the other convention, which is to place library code in a directory shocking titled...
Quaity checks live in
/test. We have several kinds of tests:
Benchmarks live at
If a project contains a single executable, it tends to live in
/exe. Since our project contains multiple executables, we use the name of the executable itself (for example
We use Stackage for nearly all packages. These are stable packages, grouped into "Stack resolver versions", so you don't need to worry about version numbers. Just stick them in your dependencies, and everything just works™.
Searching in Stackage can be done by name, or by type signature, which is very useful.