554bdc1e08
Per #28 , added some wording for the `fromIntegral` function. Removed the 'aside' for `ghcid` as this was causing more problems than it was solving. Too many install / usage dramas. Added a snippet for loading a repl with test libraries and packages loaded. Because I had completely forgotten how to do that. |
||
---|---|---|
.. | ||
bin | ||
src/FirstApp | ||
tests | ||
appconfig.json | ||
changelog.md | ||
default.nix | ||
level05.cabal | ||
level05.nix | ||
LICENCE | ||
README.md | ||
Setup.hs | ||
stack.yaml | ||
test.json |
Level 05
In this exercise we build some configuration capabilities into our application.
This exercise will require a combination of building the right types to guide your development, plus consulting plenty of documentation to leverage the chosen packages. There may also be, depending on your level of interest, some external reading for later as well.
The steps for this level:
src/FirstApp/Types.hs
src/FirstApp/Conf/File.hs
src/FirstApp/Conf.hs
src/FirstApp/Main.hs
The packages we will use for this are:
Aside: Tool Introduction - doctest
This level utilises the doctest tool to help us ensure our functions comply with some quick tests that are written as comments in the source file. This is a port of the same technology that exists in Python.
You can see the new entry in the Cabal file as another test-suite
. The
doctests.hs
lists the files that have doctests that we want to run. The
src/FirstApp/Conf/File.hs
file contains some tests that you need to update
as part of the level.
For details on running and writing doctests, refer to the documentation.