If you need a boolean to equal false, then you can use thenot function.
I wouldn’t worry about the discussion in the post you linked to. In their case, they were working on an editor and I think the function was called thousands of times when the user wrote a text of thousands of lines long.
In your and almost every use case, Elm (or rather the underlying JS code) is fast enough and you won’t need to worry too much about performance. Start worrying about it when you do an operation thousands of times per second, but especially if you notice slowness in your application.
You can write it as List.all ((|>) model.password) [ (==) model.passwordAgain, pwLength, pwIsUpper, pwIsLower, pwIsDigit ]
You can read that code as “check if all the functions in this list of functions produce True when you give them the argument model.password”
This code is using some infix functions in their regular function syntax. Another way to write it is:
The best way to handle this however is to have the functions that check the password return a List String and concatenate them. In the view, you can check for the result of the error check and if it is different than [] display the error messages.
Check the validation in elm-spa-example for inspiration on how to do this.
Looking at the implementation, List.all will exit as soon as it will encounter a False value.
In any case, I would use if pwIsLower model.password || pwIsLower model.passwordAgain then because I like the simple nature of it. Performance wise, I doubt that it will make all that much of a difference unless this is in a tight loop of some logic.