bigbinary/elm-form-field/1.1.0

Field.ValidationResult

Definition

= Passed v
| Failed e

A ValidationResult describes the state of a Field once it has been validated. It can contain the value of the field if the validation Passed or an error if the validation Failed

Mapping

map : (a -> b) -> ValidationResult x a -> ValidationResult x b

Apply a function to a ValidationResult. If the ValidationResult is Passed, it will be converted. if the ValidationResult has Failed then the failure will propogate

Apply a function to a ValidationResult. If the ValidationResult is Failed, it will be converted. if the ValidationResult has Passed then the passed state will propogate

Chaining

Chain multiple validation functions

Helpers

Get all ValidationResults that Failed

Get all ValidationResults that Passed