Skip to content

Commit

Permalink
Merge pull request qfpl#92 from qfpl/bonus-mtl
Browse files Browse the repository at this point in the history
Bonus mtl
  • Loading branch information
endgame authored Feb 20, 2020
2 parents 00192bb + 05e739e commit f48d4d8
Show file tree
Hide file tree
Showing 4 changed files with 580 additions and 21 deletions.
41 changes: 21 additions & 20 deletions INSTRUCTOR_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ We're going to be building an extremely simple web server using the 'wai'
framework. Wai is a low level HTTP implementation similar to WSGI in Python or
Rack in Ruby.

- Hackage
* Hackage
- Primary repository for Haskell packages and their documentation.
- Package **Index** is extremely useful for discovering and interrogating
packages.
Expand All @@ -27,17 +27,17 @@ Our application is starting to grow we should add another layer of assurance by
writing some tests.

We will cover:
- How to write a ``test-suite`` in the cabal file.
- Usage of the ``hspec`` library as our test runner and how to feed it our
* How to write a ``test-suite`` in the cabal file.
* Usage of the ``hspec`` library as our test runner and how to feed it our
application.
- We will also write some tests using the ``hspec-wai`` package to give us some
* We will also write some tests using the ``hspec-wai`` package to give us some
basic confidence in our error handling.

# Level 4

This covers adding a database to our application.
- We use SQLite because it requires the least amount of setup on the host machine.
- All of the SQL is provided.
* We use SQLite because it requires the least amount of setup on the host machine.
* All of the SQL is provided.

We will have the beginnings of some configuration in our application, but we
will simply hardcode this for the time being as we will have a better solution
Expand All @@ -63,12 +63,12 @@ The steps for this level:
3) ``src/Level04/DB.hs``
4) ``src/Level04/Main.hs``

- Call out `Traversable` and `Bifunctor` typeclasses.
- Call out the encoding instances & the automatic deriving of the ToJSON instances
* Call out `Traversable` and `Bifunctor` typeclasses.
* Call out the encoding instances & the automatic deriving of the ToJSON instances

# Level 5

This is the "ExceptT" level.
This is "The `ExceptT` level".

After enduring some of the annoyance of manually handling the `Either` values in various ways. This level has the students implementing their own version of the `ExceptT` monad transformer.

Expand Down Expand Up @@ -99,7 +99,7 @@ the file into a JSON Value.

# Level 7

This is "The ReaderT" level.
This is "The `ReaderT` level".

Students will be required to copy their completed versions of functions from
previous levels that will then break in this level and need to be refactored.
Expand All @@ -113,15 +113,16 @@ Also there are functions in the FirstApp/Main module that will need to be
updated to handle the new shenanigans.

## General Notes - More to add.
- readme in each level folder.
- monoid instance - rehash single/multiple number of possible instances. Don't let people hang too long on this point.
- how to find the documentation for the Header / ContentType
- more instruction that lead people to hackage documentation for Text/ByteString etc
- mention that import lists may need to be updated for the new types
- some editors will need to jump in and out of the different levels (close, cd, re-open)
- Mention that it's fine to use case statements for Either handling, we make it okay at the end.
- Mention that creating modules is easy, useful, and very helpful.
* readme in each level folder.
* monoid instance - rehash single/multiple number of possible instances. Don't let people hang too long on this point.
* how to find the documentation for the Header / ContentType
* more instruction that lead people to hackage documentation for Text/ByteString etc
* mention that import lists may need to be updated for the new types
* some editors will need to jump in and out of the different levels (close, cd, re-open)
* Mention that it's fine to use case statements for Either handling, we make it okay at the end.
* Mention that creating modules is easy, useful, and very helpful.

### IMPORTANT!
- Stephen Diehl - What I Wish I Knew Learning Haskell
- Ask students if they would prefer access to a prepared VM with the code & an editor or two.
* Stephen Diehl - [What I Wish I Knew Learning Haskell](http://dev.stephendiehl.com/hask/)
* Gabriel Gonzales - [State of the Haskell Ecosystem](https://github.com/Gabriel439/post-rfc/blob/master/sotu.md)
* Ask students if they would prefer access to a prepared VM with the code & an editor or two.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ 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 [#qfpl or #fp-course IRC channel](https://freenode.net). You can use the
Freenode [#qfpl IRC channel](https://freenode.net). You can use the
free [WebChat client](https://webchat.freenode.net).

#### Subsequent lessons may contain spoilers, don't cheat yourself out of the experience!
Expand All @@ -129,3 +129,9 @@ instructions about what the goal is for that specific level.
* 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.

### Bonus Content

Extension material that doesn't feel like it belongs to the main progression
lives in the [`bonus`](https://github.com/qfpl/applied-fp-course/tree/master/bonus)
subdirectory.
12 changes: 12 additions & 0 deletions bonus/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Bonus Content

This directory holds discussions that do not fit into the main
progression. They should make good reading for advanced students who
have completed the course, or as a reference for people taking their
knowledge onto real codebases.

# Index

* [`mtl.md`](https://github.com/qfpl/applied-fp-course/blob/master/bonus/mtl.md) -
Use the monad transformer library to build up an application monad
instead of writing everything by hand.
Loading

0 comments on commit f48d4d8

Please sign in to comment.