1
1
mirror of https://github.com/qfpl/applied-fp-course.git synced 2024-11-23 03:44:45 +03:00
Applied Functional Programming Course - Move from exercises to a working app!
Go to file
Sean Chalmers c92dbbf690 Updated README
Added beta release message:
- requesting issues/PRs
- mentioning again it was designed for a classroom
- mentioning the IRC channels
2017-10-04 10:12:20 +10:00
level01 Overhauled nix file setup to be more like the other QFPL projects. 2017-09-18 10:14:29 +10:00
level02 Overhauled nix file setup to be more like the other QFPL projects. 2017-09-18 10:14:29 +10:00
level03 Overhauled nix file setup to be more like the other QFPL projects. 2017-09-18 10:14:29 +10:00
level04 Overhauled nix file setup to be more like the other QFPL projects. 2017-09-18 10:14:29 +10:00
level05 Overhauled nix file setup to be more like the other QFPL projects. 2017-09-18 10:14:29 +10:00
level06 Overhauled nix file setup to be more like the other QFPL projects. 2017-09-18 10:14:29 +10:00
level07 Overhauled nix file setup to be more like the other QFPL projects. 2017-09-18 10:14:29 +10:00
.gitignore Overhauled nix file setup to be more like the other QFPL projects. 2017-09-18 10:14:29 +10:00
FUTURE_PLANS.md Wording updates / fixes typos 2017-09-05 15:53:21 +10:00
LICENCE Added LICENCE in accordance with CoC 2017-09-12 11:46:04 +10:00
README.md Updated README 2017-10-04 10:12:20 +10:00

Applied Functional Programming Course

* Beta Release *

This is a brand new course, so there are going to be rough edges. We invite you to submit issues or pull requests if you find errors or have suggestions on how to improve it.

This course is designed to be run in a class room with instructors, but we would like to make it suitable for self-study as well. Although this will ratchet up the difficulty a bit, we also invite suggestions on improving the course as a stand alone element.

If you do attempt this on your own and find yourself completely lost, then you may come find us on IRC on Freenode in #qfpl or #fp-course.

You:

  • Have completed, or are capable of completing, the 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.

We:

  • Have constructed a sequence of goals of increasing difficulty.
  • Have provided a framework within which to apply these goals.
  • Have included relevant components of larger applications:
    • Package dependencies
    • Project configuration
    • Application testing & building
    • Encoding / Decoding messages (JSON & Binary)
    • Persistent storage integration
    • App state & configuration management
    • Error handling & reporting
  • Will utilise both type & test driven development techniques.
  • Will explain architectural and design trade-offs when appropriate.

Setup build tools:

You're welcome to setup your own project with $ cabal init and follow along with the general flow of the course, or work through the exercises in the projects provided.

Each level is a self-contained Haskell application, containing incomplete, or as yet undefined, data types and functions. There is a Cabal and Nix file for each level, so you can use either cabal sandboxes or a nix-shell, depending on your preference.

To use a sandbox:

$ cd <levelN>
$ cabal sandbox init
$ cabal configure
$ cabal install --only-dependencies
$ $EDITOR README.md

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 given project. Easy to clean up, and package versions won't conflict with any other sandboxed project you may be working on.

To use the Nix Shell:

$ cd <levelN>
$ nix-shell
$ $EDITOR README.md

Once that completes you will be in a nix-shell environment with all the tools required to build the application for that level. Note that the 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.

The shell.nix is not provided, so if you have a different work-flow you can utilise the derivation from the respective levelN.nix.

Please note...

These lessons are designed to be completed with an instructor as part of the Data61 Applied Functional Programming Course. You are of course welcome to clone the repository and give it a try, but you may find the tasks more difficult. If you have any questions we can be contacted in the Freenode #nicta-course IRC channel. You can use the free WebChat client.

Subsequent lessons may contain spoilers, don't cheat yourself out of the experience!

There is a README.md file in each Level project that will provide instructions about what the goal is for that specific level.

  • Level 01 : Simple Hello World web app.
  • Level 02 : Define our application spec with types!
  • Level 03 : Add some flexible configuration
  • Level 04 : Testing & Tools (hspec & ghcid)
  • Level 05 : Database layer (sqlite-simple)
  • Level 06 : ReaderT & Refactoring
  • Level 07 : ExceptT & Refactoring

-- Coming Soon...

  • Level 08 : (Bonus Round) Lenses & Refactoring

-- 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.