rtfeldman / elm-validate

Convenience functions for validating Elm data.
http://package.elm-lang.org/packages/rtfeldman/elm-validate/latest
BSD 3-Clause "New" or "Revised" License
145 stars 28 forks source link

Can `validate` return a nonempty list of errors? #35

Open andys8 opened 5 years ago

andys8 commented 5 years ago

validate returns type List error for the Err case of Result.

validate :
    Validator error subject
    -> subject
    -> Result (List error) (Valid subject)

Issue

How to handle Err [ ]? Can we get rid of it?

Possible solution

Use a non-empty-list of error to represent the error case.