Assignment 12 specification

Sun Dec 16

For this assignment, let’s complete a tiny web application that produces a form for a user to change (or set) their password. It should have the usual two password boxes, as shown below.

The validation rules should require that the two passwords are exactly the same, that they have at least 8 characters, and contain at least one digit (isDigit), at least one upper-case character (isUpper), and at least one symbol (isPunctuation).

Use the techniques from the Dec 10 notes. Most of the required functions are already imported or defined below. You need these packages:

apt install ghc libghc-warp-dev libghc-blaze-html-dev libghc-mtl-dev

This validator checks whether the two passwords match, and then it invokes goodPass to make sure the but you should also ensure that they have the right length and the right kinds of characters.

TODO: your task is to do the proper validations in goodPass. You can either use expect as I did in validPhone and validEmail, or you can directly use tools like when, unless, and emit. (As given, this accepts any password of any length.)

Main program:


Given code from notes: probably don’t need to change anything below.