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

107 Commits

Author SHA1 Message Date
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
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
Sean Chalmers
519bbf86ae Updated 3/7 Readmes
Called out use of doctest in level 3.

Removed redundant language pragma.

Removed comment regarding new constructor that was not new at that stage.
2017-10-04 15:28:32 +10:00
Sean Chalmers
cc502e8d13 Fiddling with the wording of the beta release wording. 2017-10-04 11:45:24 +10:00
Sean Chalmers
feca55db72 Merge branch 'master' of gitlab.com:qfpl/applied-fp-course 2017-10-04 11:15:19 +10:00
Sean Chalmers
f3e8e57406 Replaced unhelpful 'undefined' with 'error'
Added a slightly larger comment regarding the missing constructors in the
doctests, which might not be the best idea.
2017-10-04 11:14:23 +10:00
Sean Chalmers
319009a303 Merge branch 'spelling' into 'master'
Small grammar fix

See merge request qfpl/applied-fp-course!1
2017-10-04 01:01:14 +00:00
Sean Chalmers
84ca3e60b9 Wording and grammar fixes. 2017-10-04 10:58:48 +10:00
George Wilson
9a31acc89b Small grammar fix 2017-10-04 10:42:09 +10:00
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
Sean Chalmers
0c64164e53 Updated README.
Nix information changed due to not having specific ``shell.nix`` files
anymore.
2017-09-18 10:22:10 +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
7b5ca8c97a Image now loads via HTTPS.
Image link in README should no longer trigger 'insecure content' warnings,
the link was reading from a non-HTTPS source.

Other rewordings and minor refactors
2017-09-14 14:01:47 +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
410c8b7f61 Merge branch 'master' of gitlab.com:qfpl/applied-fp-course 2017-09-12 11:47:56 +10:00
Tony Morris
ad0208776e LICENSE -> LICENCE 2017-09-12 11:47:41 +10:00
Sean Chalmers
6b59dd88ef Added LICENCE in accordance with CoC 2017-09-12 11:46:04 +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
637bde5add Stub in bracketOnError to make that function a bit less open-ended 2017-09-06 10:59:08 +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
41cc4e931d Wording updates
Removed some comments. Rephrased some other sections. Made it more obvious
when I was referring to actual types.
2017-09-06 09:01:41 +10:00
Sean Chalmers
96a81b095a Formatting tweaks 2017-09-05 16:41:30 +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
3a8a44be9f Wording updates / fixes typos 2017-09-05 15:53:21 +10:00
Sean Chalmers
2ccd70d7c9 Update level07 README 2017-09-05 15:15:02 +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