1
1
mirror of https://github.com/qfpl/applied-fp-course.git synced 2024-11-30 02:14:01 +03:00
Commit Graph

47 Commits

Author SHA1 Message Date
Sean Chalmers
dd51be0edf Remove the interpolated table exercise from example Postgres modules 2018-01-16 13:42:31 +10:00
Sean Chalmers
cd77f68897 Merged PR for adding stack.yml files and typo fixes.
Merge branch 'master' of github.com:qfpl/applied-fp-course
2018-01-16 12:47:25 +10:00
Sean Chalmers
ef0b4aa3f5 Updates based on course run feedback.
Levels 3,4, and 5 have been reordered for a better flow and more constructive
exercises.

All levels should now build on GHC versions: {7.10.3, 8.0.2, 8.2.2}

TravisCI integration added for GHC version build testing.

Probably broke a whole bunch of things in the process. *sadface*

Squashed commit of the following:

commit 203a71de3b6df2525160e76622ce846053719ddf
Author: Sean Chalmers <sean.chalmers@data61.csiro.au>
Date:   Tue Jan 16 12:33:23 2018 +1000

    Updated instructor notes, added important section for things to mention/ask

commit c8934debe9742d8ef7112ee661af7ebd3c58c7fa
Author: Sean Chalmers <sean.chalmers@data61.csiro.au>
Date:   Tue Jan 16 12:14:24 2018 +1000

    Attempt to fix weird doctest bug for level05

    One more try at travis config for the time being.

commit 85cd8a23d0d180bbd49dc5b4a40361c1bae3921d
Author: Sean Chalmers <sean.chalmers@data61.csiro.au>
Date:   Tue Jan 16 11:59:08 2018 +1000

    Deps updates and instructor notes added

commit 7898c2294f9303b89e82dd95a9714cbf6546f9b4
Author: Sean Chalmers <sean.chalmers@data61.csiro.au>
Date:   Mon Jan 15 21:20:55 2018 +1000

    Removed import of Conf from Tests on level 03

commit 9c387e90ec4142bb02dd70bdee8752b7d5779c01
Author: Sean Chalmers <sean.chalmers@data61.csiro.au>
Date:   Mon Jan 15 20:52:24 2018 +1000

    Removed other cabal check, add FirstApp.Conf to level 3 exposed modules

commit 2fe47b1cb46c240a9f5da6286af161724f334806
Author: Sean Chalmers <sean.chalmers@data61.csiro.au>
Date:   Mon Jan 15 18:40:14 2018 +1000

    Bump doctest bounds

commit 7ede0c8b9f50fa12c6d240a9778672a75ad44bfe
Author: Sean Chalmers <sean.chalmers@data61.csiro.au>
Date:   Mon Jan 15 18:16:53 2018 +1000

    Added semigroups as a dependency

commit 0d4c8e6539172487f9e2d239b74c8675ccf557dd
Author: Sean Chalmers <sean.chalmers@data61.csiro.au>
Date:   Mon Jan 15 17:48:09 2018 +1000

    CI Fixes

    - Remove sdist packaging test from travis.yml as we're not going to ever put
      these on hackage.

    - Move lower bound on time library out further for older GHCs.

commit 20053d48780451edc8b8072bf23cfd3801935795
Author: Sean Chalmers <sean.chalmers@data61.csiro.au>
Date:   Mon Jan 15 16:11:45 2018 +1000

    Expanding notes

commit 8d2e40012585828ede4ca8d506f71d504df690f9
Author: Sean Chalmers <sean.chalmers@data61.csiro.au>
Date:   Mon Jan 15 15:55:30 2018 +1000

    Expanded bounds for base & time to try to cover more GHC versions. Updated project paths in travis script

commit d4cf006bed5cc925084a26afad159ef6442b1a4c
Author: Sean Chalmers <sean.chalmers@data61.csiro.au>
Date:   Mon Jan 15 15:35:49 2018 +1000

    Removed older GHC versions that won't be tested against for now

commit 6543e1368ca179331ac25b141482b8cdb1a14d55
Author: Sean Chalmers <sean.chalmers@data61.csiro.au>
Date:   Mon Jan 15 14:56:21 2018 +1000

    Generated Travis.yml using multi-ghc-travis. Added tested-with setting to cabal files. Added cabal project file.

commit b2ccf351abaebf62a33eef2f1f062eb081c31a29
Author: Sean Chalmers <sean.chalmers@data61.csiro.au>
Date:   Mon Jan 15 14:34:52 2018 +1000

    Updated Level 07

    Use the new config structure.

    Expand the number of functions that need to be reworked because of the
    change to using ExceptT. Most involve copying previous answers, unsure
    if this will be a problem for people that aren't keeping up...

commit 6628e221488c1ed16b06b759009a4d7613bba5ea
Author: Sean Chalmers <sean.chalmers@data61.csiro.au>
Date:   Mon Jan 15 13:52:29 2018 +1000

    Update Level06

    Expand on what is to be completed in level 06 with respect to refactoring
    functions to run in a ReaderT.

    Added the new Conf structure

commit 2cbc9ff269d3e204d340a266ab472d27fbf51e7e
Author: Sean Chalmers <sean.chalmers@data61.csiro.au>
Date:   Mon Jan 15 10:59:30 2018 +1000

    Some minor adjustments for levels 6 & 7, fell out of sequence of larger changes

commit 3e964efc0b3c999930c2bfe8c69b13b63967da45
Author: Sean Chalmers <sean.chalmers@data61.csiro.au>
Date:   Mon Jan 15 10:55:52 2018 +1000

    Reordered Levels {3,4,5}.

    The new order is:
    3) Testing (was #4)
    4) Database (was #5)
    5) Config (was #3)

    This flows better with an expected wind down into the testing level
    which is not very complex. Before increasing in difficulty again with
    the Database and then external config level.

    Still TODO:
    - Find what I missed when rewriting the parts of these levels that fell
    out of sync with the new ordering.

    - Update levels 6 & 7 to use the new configuraton structure from #5.

commit 67451fffd23b06fe7ae24905c11b1e8e3b8bf279
Author: Sean Chalmers <sean.chalmers@data61.csiro.au>
Date:   Mon Jan 15 09:03:46 2018 +1000

    Fix time package version bound.

    Time version bound upped to 1.8.* for sqlite* packages.

    Stubbed out prepareAppReqs on level07.
    Removed lingering Table type on the db config.

commit de7ba8c88c83b5a4cf898f9f882f60721d804b07
Author: Sean Chalmers <sean.chalmers@data61.csiro.au>
Date:   Mon Jan 15 08:45:41 2018 +1000

    Apply latest round of changes from feedback.

    !DONE drop the "do your own thing" from the README regarding build environments
    !DONE notes about how to test the end points using CURL (4-5 requests, mix of okay & fail)
    !DONE move 'parseOptions' towards the bottom of the file (because we export it)
    !DONE add import of Data.Bifunctor (first) to Conf
    !DONE use 'try' instead of 'catch' for readObject
    !DONE add comments for some tests to write for the application
    !DONE - testing empty comments etc
    !DONE - make the test for helloMsg the last test
    !DONE change the instructions in the readme for level05 to go from DB/Types to Types to DB
    !DONE remove the Table name interpolation from the Level05
    !DONE add the SQL into the functions for people.
    !DONE change the capitalisation of the Db/DB to be consistent across files (level05)
    !DONE fix instruction for modFieldLabel to not include camel-casing instructions
    !DONE add more information to the level05 Main.hs for 'prepareAppReqs' function.
    !DONE add explicit import for IOError (System.IO.Error)
    !DONE move the optparse-applicative out, students won't complete this section. Mention it as a thing to look at.
    !DONE Remove 'Conf.Conf' from 'handleRequest' from level >=5
    !DONE Add instruction to the end of AppM to send people onwards to FirstApp/Main.
    !DONE Add type signatures to the functions in the where clause in the FirstApp/Main (level06)
    !DONE Add type signature to 'toStartUpErr' function in level07
    !DONE !IMPORTANT! Remove/Fill in the 'flushTopic' function

commit f40cf697fd7ea87ecf187ce3368ccfcde61cdadf
Author: Sean Chalmers <sean.chalmers@data61.csiro.au>
Date:   Wed Jan 10 17:11:35 2018 +1000

    Start trying to rearrange conf to be a bit more friendly
2018-01-16 12:36:57 +10:00
Sean Chalmers
07b7bd71f0
Merge pull request #3 from axman6/stack-files
Add stack files for all levels
2018-01-11 10:45:57 +10:00
Sean Chalmers
b80b5abba3 Add imports to level01/FirstApp/Main. Remove an undefined from Test.hs in level04. Update readme for cabal install instructions. Fixes #1 2018-01-10 17:09:43 +10:00
Alex Mason
174d5f8624 Add stack.yaml files for all directories. 2018-01-10 10:33:56 +10:00
Sean Chalmers
f6d4475913 Fix up Cabal file setting for exe.
Some of the cabal files had settings that made it difficult/impossible to
initiate the project specific repl. This fix allows you to use:
```
$ cabal repl level0<N>
```
To start a repl for the library for that level.

Reworded the text for the ``Error`` type on level02 as it wasn't immediately
clear that you needed to add your own constructors.

Removed the default constructor for (``RqType``, ``Error``, ``ContentType``) to
try to make it more obvious that you have things to do there. Turned off the
'dodgy-imports' warning for that file specifically to allow for happy repl'ing.
2017-10-17 10:34:28 +10:00
Sean Chalmers
59a516d481 Updated DB for more clarity about withTable.
Added doctests and a shout out to what is going on with "$$tablename$$" in the
``withTable`` function.

Updated the level04 tests file to be a bit more defined and provide an example
of a test that Hspec.Wai lets you write. Information was very thin on the ground
in that file so it would have been too difficult without assistance.

Provided a bit more information about cool things that ``ghcid`` can do that I
didn't know about. :D

Fixes #9, #7, #5
2017-10-05 09:18:18 +10:00
Sean Chalmers
dc26080f6c Updated l4 readme 2017-10-04 15:40:50 +10:00
Sean Chalmers
418ce19e02 Overhauled nix file setup to be more like the other QFPL projects.
- Regenerated the individual nix files.
- Removed the shell.nix files

Just running ``$ nix-build`` in levels greater than 2 currently
doesn't succeed, still working on this. The nix-shell environments
work as expected for all levels.
2017-09-18 10:14:29 +10:00
Sean Chalmers
eae7f839d5 Removes a function that was just constructors
Fixes #2
2017-09-12 15:42:07 +10:00
Sean Chalmers
9bab205678 Merge branch 'master' of gitlab.com:qfpl/applied-fp-course 2017-09-12 13:41:26 +10:00
Sean Chalmers
4401cd65c9 Added -fwarn-missing-import-lists to GHC options. Fixed resulting errors 2017-09-12 13:28:27 +10:00
Tony Morris
5666f74aa1 update copyright notice 2017-09-12 11:51:26 +10:00
Tony Morris
ad0208776e LICENSE -> LICENCE 2017-09-12 11:47:41 +10:00
Sean Chalmers
00e02a3f9d Rebuilt Conf File Read Handling
Made the error management for loading the JSON config file work as one might
expect it should. Expanded the error reporting expectations to include specific
file reading and JSON decoding errors.

The difficulties that will be had in handling the multiple either values will
motivate latter sections RE ExceptT (EitherT) transformers. However there is
nothing here that should be beyond people that do not know how transformers
work.

Added more doctests to the different moving parts to make things a bit clearer.
Added doctests to the cabal files and included a 'doctests.hs' to the tests
section.

default.nix files have been updated with the bonus dependency.
2017-09-12 11:21:27 +10:00
Sean Chalmers
ec1bb07dae Add guidance about handling requests without persistent storage.
There is no persistent storage in the application by the time we're expecting
students to write ``Response`` handling functions. So add some more guidance
that we only expect placeholder values to be used, this wasn't sufficiently
clear. Fixes #3

Updated the latter placeholder values to match the guidance offered, for
consistency.

Updated the configuration ``helloMsg`` value and some of the tests to be a bit
more sensible, even if only a little.
2017-09-11 10:29:56 +10:00
Sean Chalmers
71a5c2f275 Issue fixes.
Reworded ``Error`` blurb to direct people to try to write other functions and
see what errors are needed. Fixes #1

Changed the ``Port`` type to ``Word16`` to be more precise about what values we
allow for a port number. Add a helper function to take a ``Conf`` to the ``Int``
value that Wai requires. Fixes #4
2017-09-11 09:46:17 +10:00
Sean Chalmers
f458bb074f Wording updates, description adjustments 2017-09-06 10:54:50 +10:00
Sean Chalmers
71e9982e08 Documentation updates. Removed some comments 2017-09-06 10:15:24 +10:00
Sean Chalmers
0dbad01d36 Removed some unnecessary comments/code 2017-09-06 09:35:33 +10:00
Sean Chalmers
b0f95deae9 Fixed a bug, reworded a bit, refactored a bit 2017-09-06 09:19:49 +10:00
Sean Chalmers
934f63497d Restructure part of the Conf.hs to provide more to do and with added guidance 2017-09-05 16:36:42 +10:00
Sean Chalmers
dc42b2091f Wording/formatting updates 2017-09-05 16:13:38 +10:00
Sean Chalmers
b69770bdbc Name changes to Applied name.
Wording and phrasing updates. Some functions changed around a bit to
be slightly less 'weird'.
2017-09-05 13:53:05 +10:00
Sean Chalmers
b3e15c2acd Wording updates
Changed the wording of some sections. Added more info to some of the
exercise README files.

Added some more structure to the tests exercise to make it a little
less open. Still undefined sections but there is a bit more guidance
about what things might look like.

Preparation for the name change to 'Applied' instead of 'Advanced'
2017-09-05 11:34:56 +10:00
Sean Chalmers
d59af985cb Updated layout of cabal files. Turned off some warnings for unused matches 2017-09-04 11:35:33 +10:00
Sean Chalmers
0aa03de8f1 Typo fixes, word changes to reduce the silly. 2017-09-04 11:04:52 +10:00
Sean Chalmers
58b7b7b575 Use correct content-type header.
The ContentType header text for JSON was incorrect as 'text/json',
and it has been updated to 'application/json'.
2017-09-04 10:41:45 +10:00
Sean Chalmers
942d093011 Formatting Adjustments
Just making things consistent across the various levels.
2017-09-04 10:20:31 +10:00
Sean Chalmers
2f20e0736c Level Readme Adjustments
I just found out about reference links in Markdown, this has the ability
to make the README markdown much easier to digest without losing the
nice ability to have hyperlinks directly in the documentation. But leaves
the text easier to digest for people that are not reading it through a
_Markdown prism.
2017-09-04 10:02:55 +10:00
Sean Chalmers
05d9ce923d Updated Response Builder Functions
Changed up the Response builder functions to be consistent with
the need to pass in the ContentType when constructing the response.
2017-09-04 09:29:38 +10:00
Sean Chalmers
a16b8d5849 All projects now compile without error. Certain warnings have been suppressed at a module level. Some types have been added back in to grease the wheels of getting underway 2017-09-01 14:27:41 +10:00
Sean Chalmers
7ee4a56bbe Updated ghc-options to remove -Werror, update to match options used by original fp-course 2017-09-01 11:26:26 +10:00
Sean Chalmers
f41ee50c75 change changelog files to lowercase 2017-09-01 11:17:26 +10:00
Sean Chalmers
30df1c9252 Banishing some words.
'Simply' and 'Just' are banned from instructional documentation, imo. Often, for
the people using these exercises, things are rarely either.
2017-08-31 15:39:58 +10:00
Sean Chalmers
b6d7786f92 More readme updates
Added a note about ghcid
2017-08-31 14:25:32 +10:00
Sean Chalmers
86fc64c3dd Add some more guidance.
Added readme files to the individual exercises to help point people in the right
direction when they get started. Probably more useful to the people that are
wanting to try this by themselves.
2017-08-31 11:31:08 +10:00
Sean Chalmers
4aa22d0e0b More wording updates
Removed more commented out code, removed some of the hand holding I had
and added some more indication of when you should probably just reach
for the docs
2017-08-24 14:34:01 +10:00
Sean Chalmers
5ba01551ad Wording updates.
Removing some commented out code.
2017-08-24 14:10:59 +10:00
Sean Chalmers
d901dedf24 Questions, questions... 2017-08-23 17:14:29 +10:00
Sean Chalmers
f7889ad714 Databasezz!
Added level05: installing a DB layer.

Updated the cabal files with a nice ghc-option of '-Wall -Werror'.

Added some more comments to the level04 testing page.
2017-08-15 15:17:04 +10:00
Sean Chalmers
14e7e81f46 Fix project restructure
Didn't properly move out the Main files to a separate location so
the dependencies and app building was a bit wacky. This fixes that.
2017-08-14 16:48:34 +10:00
Sean Chalmers
803e6c58e9 Clean Up
Don't need the extra status declarations for some of the Hspec tests
at level04 as hspec-wai assumes 200 until told otherwise.

Removed Hedgehog from level04 tests, don't have a good use case.
2017-08-11 15:54:21 +10:00
Sean Chalmers
8f8bb6c123 Minor adjustments 2017-08-11 15:30:00 +10:00
Sean Chalmers
d9ee08993b Fixing structure of Level03 2017-08-11 10:55:12 +10:00
Sean Chalmers
e701b91a7b Add Level 04
Level 04 contains some testing fun.

Removed spurious yaml file from level03.

Update README.

Have noticed irritating snafu RE the app structure. Not built as a
library in other levels, will fix.
2017-08-11 10:40:05 +10:00