class Dry::Monads::Validated

Validated is similar to Result and represents an outcome of a validation. The difference between Validated and Result is that the former implements ‘#apply` in a way that concatenates errors. This means that the error type has to have `+` implemented (be a semigroup). This plays nice with arrays and lists. Also, List<Validated>#traverse implicitly uses a block that wraps errors with a list so that you don’t have to do it manually.

@example using with List

List::Validated[Valid('London'), Invalid(:name_missing), Invalid(:email_missing)]
# => Invalid(List[:name_missing, :email_missing])

@example with valid results

List::Validated[Valid('London'), Valid('John')]
# => Valid(List['London', 'John'])