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

292 Commits

Author SHA1 Message Date
Alistair Burrowes
1f5de69fdb Update to stackage LTS 10 (GHC 8.2.2)
Includes some version bumps required for the stackage version.
2018-01-31 12:20:33 +11:00
Jack Kelly
1cbdafd62d Move Topic/CommentText into their own modules to hide constructors 2018-01-30 18:06:42 +11:00
Sean Chalmers
ac25d90ddf Relaxing version bounds for hspec-wai, adding upper bound. 2018-01-28 21:53:17 +10:00
Sean Chalmers
51b0ba4e1c
Merge pull request #17 from qfpl/new-transformer-exercises
New transformer exercises, version 1. Fixes #16
2018-01-28 21:37:15 +10:00
Sean Chalmers
2a35db9d5b Keeping in sync with latest updates to master 2018-01-27 15:32:27 +10:00
Sean Chalmers
8bb45ce073 Update wording 2018-01-27 15:11:43 +10:00
Sean Chalmers
6e41c254d8 Added some tests, renamed the throwLeft function, added some better wording for Level06 AppM 2018-01-27 15:04:36 +10:00
Sean Chalmers
b03fa5912d Change up some wording 2018-01-26 15:24:44 +10:00
Sean Chalmers
827da8d8fa
Merge pull request #18 from qfpl/remove-silly-json-exercise
Remove silly json exercise
2018-01-26 16:20:32 +11:00
Sean Chalmers
aa5457ba64 Make the json config file loading exercises a bit more realistic. 2018-01-25 16:17:36 +10:00
Sean Chalmers
2a8361639a Fix level07 tests 2018-01-25 11:40:24 +10:00
Sean Chalmers
f3d80ddd58 Fix tests of level06, new type error after arg swap 2018-01-25 11:32:27 +10:00
Sean Chalmers
4ed088988d Argument order changed for runAppM, update to fix 2018-01-25 11:06:28 +10:00
Sean Chalmers
a5fe28c66d Add FromJSON typeclass for students to complete. Start work on factoring out the silly functions 2018-01-25 11:02:59 +10:00
Sean Chalmers
08b9f3382f Update wording for level 6 AppM exercise 2018-01-25 10:47:24 +10:00
Sean Chalmers
0533234839 First cut of the new transformer exercises 2018-01-24 15:35:52 +10:00
Sean Chalmers
d1c95fba53 Fix snafu'd partialConf construction and Aeson imports 2018-01-22 12:29:03 +10:00
Sean Chalmers
959eb576aa Issue Fixes & More feedback driven development
Fixes: #15, #13, #14, #11, #8

Add the IDEAS to a 'Suggestions' section in the FUTURE_PLANS file.

* Updated the cabal instructions for level 03
* Removed the duplicated config loading in level 05
* Add the implementations for File.hs for levels 06 & 07
* Renamed the slightly misleading 'readObject' function
* Fixed the capitalisation of init and close DB functions between levels
  04 & 05.
2018-01-22 11:40:11 +10:00
Sean Chalmers
48132f0c2a
Merge pull request #12 from newhoggy/missing-quotes
Add missing quotes and whitespace in doctests
2018-01-22 08:33:49 +10:00
Sean Chalmers
86f1bdb6fb
Merge pull request #10 from ScottSedgwick/FixLevel03Comment
Remove obsolete test comment
2018-01-22 08:33:16 +10:00
John Ky
ddc9c2762c Add missing whitespace 2018-01-18 11:40:49 +11:00
John Ky
690a244444 Add missing double quotes 2018-01-18 11:38:34 +11:00
Scott Sedgwick
4518a166de Remove obsolete test comment 2018-01-17 13:49:47 +11:00
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
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
213298ba5d Update TravisCI svg for master branch 2018-01-16 12:39:09 +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
fa4217e637
Merge pull request #6 from endgame/patch-2
level07: Fix typo
2018-01-12 13:49:03 +10:00
Sean Chalmers
491354a1f3
Merge pull request #5 from endgame/patch-1
level05: fix typo in DB.hs
2018-01-12 13:48:33 +10:00
endgame
2446d7a8ff
level07: Fix typo 2018-01-11 16:47:42 +10:00
endgame
6ad3fefce8
level05: fix typo in DB.hs 2018-01-11 14:32:03 +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
Alex Mason
9103400696 Add stack.yaml for level01 2018-01-10 10:16:45 +10:00
Sean Chalmers
b187316561 Add more instructive comment to DbComment type in level05 2017-12-18 08:56:36 +10:00
Sean Chalmers
bfa7c5511c Fixed typo in PostgreSQL module 2017-12-13 17:23:47 +10:00
Sean Chalmers
cf98d2c942 Fix a reference to the nicta IRC channel. Update some comments / formatting in Main.hs for level 2 and 3. 2017-12-13 15:37:06 +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
15e8022c0f Fix type signature on Level03/Conf.
Return type needed to be ``Either ..``.
2017-10-16 14:05:46 +10:00
Sean Chalmers
585deaff11 Change type variable to concrete type.
Some whitespace and typo fixes.
2017-10-16 11:50:39 +10:00
Sean Chalmers
16f1705892 Replaced undefined usage with error.
Fixes #12
2017-10-05 15:45:36 +10:00
Sean Chalmers
1757ac94fd Merge branch 'level05-tweaks' into 'master'
Level05 tweaks

See merge request qfpl/applied-fp-course!2
2017-10-05 05:38:52 +00:00
Andrew McCluskey
4af4c3c845 Level05 tweaks 2017-10-05 05:38:50 +00:00
Sean Chalmers
94711343b6 modFieldLabel in level05+ is 'almost' just the identity.
But that was largely due to missing field prefixes in the Comment record for
that level. Field prefixes added back in and added some doctests and changed the
wording for that section to explain a bit more of what is going on.
2017-10-05 14:35:39 +10:00
Sean Chalmers
f63d3ee483 Fixes #11
Changed an ``undefined`` to a ``error "msg"`` and reworded some READMEs
2017-10-05 13:20:21 +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
83b954fb5d Update SQL Injection Risk Comment.
The application only kinda-sorta has an SQL injection risk given that the config
has to be compromised and the application restarted to load the new config. Even
in a learning application like this one it's worth mentioning but still going to
be far from your biggest problem if someone has that level of access to your
servers.

Fixes #8
2017-10-05 08:53:25 +10:00
Sean Chalmers
dc26080f6c Updated l4 readme 2017-10-04 15:40:50 +10:00