Thanks to assistance in this thread, I was able to rethink my code to make it more consistent. I did not end up including the List functions, as I am not able to clearly reason my way through them yet.
As an aspiring elm programmer, I would highly appreciate it if you could review my code from the perspective of a team leader or tech lead and advise where I could improve if this was my given task and the code was to be used in production.
The reasoning I went through to code the solution the way I did was as follows:
-
If the code was to be called more than once, place it in a function, so that it is only defined in one place.
-
Make similar functions have the same type signature, so that one general helper function (viewDrawSymbol) can call the individual helper functions (pwIsLength) consistently.
-
Use pw for password, to shorten the code.
-
Elm gave me the confidence to code this in a novel way, where each criteria of the password is checked as the user types.
Please have a look at this code.