Code Review: Password Form

You could look at your validation checks. Do you need to check against model.passwordAgain as well as model.password?

Personally, I wouldn’t do the validation check on model.passwordAgain - only on model.password. The reason being:

  1. Your messages to the user only state ‘Password must …’
  2. You have pwIsMatched in place, so when model.password passes all the validation, you know that model.passwordAgain does too if this function returns True.

If you must check both, comparing both with an || means the user will get a check mark if just model.passwordAgain passes, which doesn’t make sense to me. It may better to use && to check both pass the validation.

You have a typo in pwIsUpper, you are checking model.password twice.

You could write viewSubmitButton like so (just a suggestion):

viewSubmitButton : Model -> Html msg
viewSubmitButton model =
    let
         disabled_ =
             not (pwLength model && pwIsUpper model && pwIsLower model && pwIsDigit model && pwIsMatched model)
    in
    button [ disabled disabled_ ] [ text "Submit" ]

Otherwise all looks good to me.