2017-08-30 08:42:46 +03:00
|
|
|
# Advanced Functional Programming Course
|
|
|
|
|
2017-08-31 04:50:50 +03:00
|
|
|
<img src="http://i.imgur.com/0h9dFhl.png" height="400" width="640" />
|
2017-08-07 06:21:51 +03:00
|
|
|
|
2017-08-24 09:06:48 +03:00
|
|
|
### You:
|
2017-08-07 06:21:51 +03:00
|
|
|
|
2017-08-31 07:25:32 +03:00
|
|
|
* Have completed, or are capable of completing, the [Data61 FP Course](https://github.com/data61/fp-course).
|
|
|
|
* Have a few months self-study to your name.
|
|
|
|
* Want to know how to build larger applications with statically typed FP.
|
|
|
|
* Are willing to accept that a web application is a sufficient choice, for now.
|
2017-08-07 06:21:51 +03:00
|
|
|
|
2017-08-24 09:06:48 +03:00
|
|
|
### We:
|
2017-08-07 06:21:51 +03:00
|
|
|
|
2017-08-31 07:25:32 +03:00
|
|
|
* Have constructed a sequence of goals of increasing difficulty.
|
|
|
|
* Have provided a framework within which to apply these goals.
|
2017-08-07 06:21:51 +03:00
|
|
|
* Have included relevant components of larger applications:
|
|
|
|
- Package dependencies
|
|
|
|
- Project configuration
|
|
|
|
- Application testing & building
|
2017-08-07 09:23:32 +03:00
|
|
|
- Encoding / Decoding messages (JSON & Binary)
|
2017-08-07 06:21:51 +03:00
|
|
|
- Persistent storage integration
|
|
|
|
- App state & configuration management
|
|
|
|
- Error handling & reporting
|
2017-08-31 07:25:32 +03:00
|
|
|
* Will utilise both type & test driven development techniques.
|
|
|
|
* Will explain architectural and design trade-offs when appropriate.
|
2017-08-07 06:21:51 +03:00
|
|
|
|
2017-09-01 02:32:42 +03:00
|
|
|
### Setup build tools:
|
2017-08-09 06:06:21 +03:00
|
|
|
|
2017-08-24 09:06:48 +03:00
|
|
|
You're welcome to setup your own project with ``$ cabal init`` and follow along
|
2017-08-24 09:23:07 +03:00
|
|
|
with the general flow of the course, or work through the exercises in the
|
2017-09-01 07:27:41 +03:00
|
|
|
projects provided.
|
2017-08-24 09:23:07 +03:00
|
|
|
|
2017-08-31 07:25:32 +03:00
|
|
|
Each level is a self-contained Haskell application, containing incomplete, or as
|
2017-08-30 08:42:46 +03:00
|
|
|
yet undefined, data types and functions. There is a cabal file and Nix
|
|
|
|
configuration files for each level, so you can use either cabal sandboxes or a
|
|
|
|
``nix-shell``, depending on your preference.
|
|
|
|
|
|
|
|
To use a sandbox:
|
|
|
|
```bash
|
|
|
|
$ cd <levelN>
|
|
|
|
$ cabal sandbox init
|
|
|
|
$ cabal configure
|
|
|
|
$ cabal install --only-dependencies
|
|
|
|
```
|
|
|
|
The normal cabal build commands should then work as expected. We do recommend
|
|
|
|
using cabal sandboxes as they provide a contained Haskell environment for a
|
2017-08-31 07:25:32 +03:00
|
|
|
given project. Easy to clean up, and package versions won't conflict with any other
|
2017-08-30 08:42:46 +03:00
|
|
|
sandboxed project you may be working on. Hence their name.
|
|
|
|
|
|
|
|
To use the Nix Shell:
|
|
|
|
```bash
|
|
|
|
$ cd <levelN>
|
|
|
|
$ nix-shell
|
|
|
|
```
|
|
|
|
Once that completes you will be in a ``nix-shell`` environment with all the
|
2017-08-31 07:25:32 +03:00
|
|
|
tools required to build the application for that level. Note that the
|
2017-08-30 08:42:46 +03:00
|
|
|
levels build on each other, so you can go to the highest level and enter a
|
|
|
|
nix-shell there, you will then have all the required tools for every level.
|
2017-08-17 09:48:54 +03:00
|
|
|
|
2017-08-30 08:42:46 +03:00
|
|
|
The ``shell.nix`` is provided separate from the ``default.nix`` so if you have a
|
|
|
|
different workflow you can still utilise the derivation.
|
|
|
|
|
|
|
|
##### Please note...
|
|
|
|
|
|
|
|
These lessons are designed to be completed with an instructor as part of the
|
|
|
|
Data61 Advanced Functional Programming Course. You are of course welcome to
|
|
|
|
clone the repository and give it a try, but you may find the tasks more
|
2017-08-31 07:25:32 +03:00
|
|
|
difficult. If you have any questions we can be contacted in the
|
2017-09-01 02:32:42 +03:00
|
|
|
Freenode [#nicta-course IRC channel](https://freenode.net). You can use the
|
2017-08-30 08:42:46 +03:00
|
|
|
free [WebChat client](https://webchat.freenode.net).
|
|
|
|
|
|
|
|
#### Subsequent lessons may contain spoilers, don't cheat yourself out of the experience!
|
2017-08-09 06:06:21 +03:00
|
|
|
|
2017-09-01 07:27:41 +03:00
|
|
|
There is a ``README.md`` file in each Level project that will provide instructions about
|
|
|
|
what the goal is for that specific level.
|
|
|
|
|
2017-08-10 09:25:08 +03:00
|
|
|
* Level 01 : Simple Hello World web app.
|
|
|
|
* Level 02 : Define our application spec with types!
|
|
|
|
* Level 03 : Add some flexible configuration
|
2017-08-11 08:54:21 +03:00
|
|
|
* Level 04 : Testing & Tools (hspec & ghcid)
|
2017-08-18 09:14:54 +03:00
|
|
|
* Level 05 : Database layer (sqlite-simple)
|
2017-08-10 09:25:08 +03:00
|
|
|
* Level 06 : ReaderT & Refactoring
|
|
|
|
* Level 07 : ExceptT & Refactoring
|
2017-08-17 09:48:54 +03:00
|
|
|
|
2017-08-24 09:06:48 +03:00
|
|
|
-- Coming Soon...
|
2017-08-10 09:25:08 +03:00
|
|
|
* Level 08 : (Bonus Round) Lenses & Refactoring
|
|
|
|
|
2017-08-30 08:42:46 +03:00
|
|
|
-- Maybe...
|
|
|
|
* Level 09 : Add session controls (login, logout) and a protected route. So we
|
|
|
|
can have something that resembles application state. For the purposes of
|
|
|
|
modelling the state machine and implementing some property based tests.
|
2017-08-08 02:45:19 +03:00
|
|
|
|