title: Scala - how to validate every String in list using Validated monad from cats?
body: <p>I have a list of <code>Strings</code> which I need to validate if they are match some pattern:</p>
  <pre><code>def validate(strings: List[String]): Either[WrongStringError, List[String]] = {
      strings.foreach(s =&gt; checkString(s))
      Right(strings)
    }
  
  private def checkString(s: String): Validated[WrongStringError, String] = {
    val pattern = .... //some regex
    Either.catchNonFatal(s.matches(pattern))
      .left
      .map(_ =&gt; WrongStringError(s&quot;Given string: ${s} is not valid.&quot;))
    }.toValidated
  </code></pre>
  <p>But, what I want to achieve is to accomulate all errors together. If for example 3 of 5 strings are incorrect I want return error with them to the user. I thought of using <code>Validated</code> monad from <code>cats</code> but I did not get result.
  How can I validate list of strings and return list of errors for those which are incorrect?</p>