The example here shows how you can encode it to do...
# arrow
r
The example here shows how you can encode it to do both error accumulation or fail fast: https://arrow-kt.io/docs/patterns/error_handling/#example--alternative-validation-strategies-using-applicativeerror
Copy code
Rules failFast {
  listOf(
    FormField("Invalid Email Domain Label", "<http://nowhere.com|nowhere.com>"),
    FormField("Too Long Email Label", "nowheretoolong${(0..251).map { "g" }}"), //this fails fast 
    FormField("Valid Email Label", "<mailto:getlost@nowhere.com|getlost@nowhere.com>")
  ).map { it.validateEmail() }
}