elm-form-validations
elm-form-validations copied to clipboard
Adding type safety to validation.
Problem with ValidationError = Maybe String
is that amongs other
things it does not handle customization well; how can I provide my own
error messages if API describes validations errror as Maybe String?
This commit introduces this abstraction with type safety; defining a data constructor for each possible validation error. Public API has not changed and errorsList returns same thing as in previous versions.
A new function was introduced, validationErrorToString which serves as a blueprint for custom error messages. User has to define their own validationErrorToString message.
refs #1