1
1
mirror of https://github.com/qfpl/applied-fp-course.git synced 2024-11-26 06:38:40 +03:00
applied-fp-course/level05
Sean Chalmers 69bcc3e754 Reworded comment about newtypes
Changed comment in Types module about the different ways of defining a newtype
2018-01-16 14:18:45 +10:00
..
bin Updates based on course run feedback. 2018-01-16 12:36:57 +10:00
src/FirstApp Reworded comment about newtypes 2018-01-16 14:18:45 +10:00
tests Updates based on course run feedback. 2018-01-16 12:36:57 +10:00
appconfig.json Updates based on course run feedback. 2018-01-16 12:36:57 +10:00
changelog.md change changelog files to lowercase 2017-09-01 11:17:26 +10:00
default.nix Overhauled nix file setup to be more like the other QFPL projects. 2017-09-18 10:14:29 +10:00
level05.cabal Updates based on course run feedback. 2018-01-16 12:36:57 +10:00
level05.nix Updates based on course run feedback. 2018-01-16 12:36:57 +10:00
LICENCE update copyright notice 2017-09-12 11:51:26 +10:00
README.md Updates based on course run feedback. 2018-01-16 12:36:57 +10:00
Setup.hs Added Level05 - Add a database [WIP] 2017-08-11 16:28:56 +10:00
stack.yaml Add stack.yaml files for all directories. 2018-01-10 10:33:56 +10:00
test.json Updates based on course run feedback. 2018-01-16 12:36:57 +10:00

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:

  1. src/FirstApp/Types.hs
  2. src/FirstApp/Conf/File.hs
  3. src/FirstApp/Conf.hs
  4. 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.