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.
validatereturns typeList errorfor theErrcase ofResult.Issue
How to handle
Err [ ]? Can we get rid of it?Possible solution
Use a non-empty-list of
errorto represent the error case.(firstError, otherErrors) : (error, List error)